@@ -16,6 +16,7 @@ | |||||
<None Remove="Image\buttonOn.png" /> | <None Remove="Image\buttonOn.png" /> | ||||
<None Remove="Image\Cb_Checked.png" /> | <None Remove="Image\Cb_Checked.png" /> | ||||
<None Remove="Image\Cb_HalfChecked.png" /> | <None Remove="Image\Cb_HalfChecked.png" /> | ||||
<None Remove="Image\Exp.png" /> | |||||
<None Remove="Image\hbl.ico" /> | <None Remove="Image\hbl.ico" /> | ||||
<None Remove="Image\HBL.png" /> | <None Remove="Image\HBL.png" /> | ||||
<None Remove="Image\iconfont.ttf" /> | <None Remove="Image\iconfont.ttf" /> | ||||
@@ -47,9 +48,13 @@ | |||||
<None Remove="Image\tittle.png" /> | <None Remove="Image\tittle.png" /> | ||||
<None Remove="Image\topImage.png" /> | <None Remove="Image\topImage.png" /> | ||||
<None Remove="Image\topTitle.png" /> | <None Remove="Image\topTitle.png" /> | ||||
<None Remove="Image\上箭头.png" /> | |||||
<None Remove="Image\不规则矩形.png" /> | <None Remove="Image\不规则矩形.png" /> | ||||
<None Remove="Image\个人信息.png" /> | <None Remove="Image\个人信息.png" /> | ||||
<None Remove="Image\临时模板.png" /> | |||||
<None Remove="Image\产品制作.png" /> | |||||
<None Remove="Image\内部.png" /> | <None Remove="Image\内部.png" /> | ||||
<None Remove="Image\功能列表.png" /> | |||||
<None Remove="Image\告警.png" /> | <None Remove="Image\告警.png" /> | ||||
<None Remove="Image\告警\Wifi_NO.ico" /> | <None Remove="Image\告警\Wifi_NO.ico" /> | ||||
<None Remove="Image\告警\Wifi_NO.png" /> | <None Remove="Image\告警\Wifi_NO.png" /> | ||||
@@ -162,6 +167,11 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<Resource Include="Image\btn_close.png" /> | <Resource Include="Image\btn_close.png" /> | ||||
<Resource Include="Image\Exp.png" /> | |||||
<Resource Include="Image\上箭头.png" /> | |||||
<Resource Include="Image\临时模板.png" /> | |||||
<Resource Include="Image\产品制作.png" /> | |||||
<Resource Include="Image\功能列表.png" /> | |||||
<Resource Include="Image\告警\Wifi_NO.png" /> | <Resource Include="Image\告警\Wifi_NO.png" /> | ||||
<Resource Include="Image\告警\Wifi_OK.png" /> | <Resource Include="Image\告警\Wifi_OK.png" /> | ||||
<Resource Include="Image\告警\严重告警.png" /> | <Resource Include="Image\告警\严重告警.png" /> | ||||
@@ -23,6 +23,269 @@ | |||||
</LinearGradientBrush> | </LinearGradientBrush> | ||||
<SolidColorBrush x:Key="Menu.Static.Background" Color="#FFF0F0F0"/> | <SolidColorBrush x:Key="Menu.Static.Background" Color="#FFF0F0F0"/> | ||||
<SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="#FF333333"/> | |||||
<SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="#FFFFFFFF"/> | |||||
<SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#FF333333"/> | |||||
<SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF"/> | |||||
<SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF"/> | |||||
<SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000"/> | |||||
<SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD"/> | |||||
<SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF"/> | |||||
<SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000"/> | |||||
<SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC"/> | |||||
<SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6"/> | |||||
<SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070"/> | |||||
<Style x:Key="ExpanderHeaderFocusVisual"> | |||||
<Setter Property="Control.Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate> | |||||
<Border> | |||||
<Rectangle Margin="0" StrokeDashArray="1 2" Stroke="Black" SnapsToDevicePixels="true" StrokeThickness="1"/> | |||||
</Border> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}"> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> | |||||
<Border Padding="{TemplateBinding Padding}" Cursor="Hand"> | |||||
<Grid SnapsToDevicePixels="False" Margin="5" Height="35"> | |||||
<Grid.Background> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Exp.png"></ImageBrush> | |||||
</Grid.Background> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="35"/> | |||||
<ColumnDefinition Width="*"/> | |||||
</Grid.ColumnDefinitions> | |||||
<Image Margin="10,0,0,0" Width="15" Source="/BPASmartClient.CustomResource;component/Image/上箭头.png"></Image> | |||||
<Ellipse x:Name="circle" Visibility="Collapsed" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/> | |||||
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" Visibility="Collapsed" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/> | |||||
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/> | |||||
</Grid> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="true"> | |||||
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/> | |||||
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}"> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> | |||||
<Border Padding="{TemplateBinding Padding}"> | |||||
<Grid Background="Transparent" SnapsToDevicePixels="False"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="19"/> | |||||
<ColumnDefinition Width="*"/> | |||||
</Grid.ColumnDefinitions> | |||||
<Grid> | |||||
<Grid.LayoutTransform> | |||||
<TransformGroup> | |||||
<TransformGroup.Children> | |||||
<TransformCollection> | |||||
<RotateTransform Angle="180"/> | |||||
</TransformCollection> | |||||
</TransformGroup.Children> | |||||
</TransformGroup> | |||||
</Grid.LayoutTransform> | |||||
<Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/> | |||||
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/> | |||||
</Grid> | |||||
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/> | |||||
</Grid> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="true"> | |||||
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/> | |||||
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}"> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> | |||||
<Border Padding="{TemplateBinding Padding}"> | |||||
<Grid Background="Transparent" SnapsToDevicePixels="False"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="19"/> | |||||
<RowDefinition Height="*"/> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<Grid.LayoutTransform> | |||||
<TransformGroup> | |||||
<TransformGroup.Children> | |||||
<TransformCollection> | |||||
<RotateTransform Angle="90"/> | |||||
</TransformCollection> | |||||
</TransformGroup.Children> | |||||
</TransformGroup> | |||||
</Grid.LayoutTransform> | |||||
<Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/> | |||||
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/> | |||||
</Grid> | |||||
<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" RecognizesAccessKey="True" Grid.Row="1" SnapsToDevicePixels="True" VerticalAlignment="Top"/> | |||||
</Grid> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="true"> | |||||
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/> | |||||
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}"> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> | |||||
<Border Padding="{TemplateBinding Padding}"> | |||||
<Grid Background="Transparent" SnapsToDevicePixels="False"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="19"/> | |||||
<RowDefinition Height="*"/> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<Grid.LayoutTransform> | |||||
<TransformGroup> | |||||
<TransformGroup.Children> | |||||
<TransformCollection> | |||||
<RotateTransform Angle="-90"/> | |||||
</TransformCollection> | |||||
</TransformGroup.Children> | |||||
</TransformGroup> | |||||
</Grid.LayoutTransform> | |||||
<Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/> | |||||
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/> | |||||
</Grid> | |||||
<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" RecognizesAccessKey="True" Grid.Row="1" SnapsToDevicePixels="True" VerticalAlignment="Top"/> | |||||
</Grid> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="true"> | |||||
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/> | |||||
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/> | |||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/> | |||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style TargetType="{x:Type Expander}"> | |||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> | |||||
<Setter Property="Background" Value="Transparent"/> | |||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> | |||||
<Setter Property="VerticalContentAlignment" Value="Stretch"/> | |||||
<Setter Property="BorderBrush" Value="Transparent"/> | |||||
<Setter Property="BorderThickness" Value="1"/> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type Expander}"> | |||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true"> | |||||
<DockPanel> | |||||
<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> | |||||
<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/> | |||||
</DockPanel> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsExpanded" Value="true"> | |||||
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/> | |||||
</Trigger> | |||||
<Trigger Property="ExpandDirection" Value="Right"> | |||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/> | |||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/> | |||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/> | |||||
</Trigger> | |||||
<Trigger Property="ExpandDirection" Value="Up"> | |||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/> | |||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/> | |||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/> | |||||
</Trigger> | |||||
<Trigger Property="ExpandDirection" Value="Left"> | |||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/> | |||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/> | |||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style TargetType="{x:Type Menu}"> | <Style TargetType="{x:Type Menu}"> | ||||
<Setter Property="Background" Value="Transparent"/> | <Setter Property="Background" Value="Transparent"/> | ||||
<Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/> | <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/> | ||||
@@ -122,6 +122,36 @@ | |||||
</Style.Setters> | </Style.Setters> | ||||
</Style> | </Style> | ||||
<Style x:Key="imagetop_维护" TargetType="Image"> | |||||
<Style.Setters> | |||||
<Setter Property="Width" Value="20"></Setter> | |||||
<Setter Property="Height" Value="22"></Setter> | |||||
<Setter Property="VerticalAlignment" Value="Top"></Setter> | |||||
<Setter Property="HorizontalAlignment" Value="Center"></Setter> | |||||
<Setter Property="Source" Value="/BPASmartClient.CustomResource;component/Image/维护.png"/> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="imagetop_功能列表" TargetType="Image"> | |||||
<Style.Setters> | |||||
<Setter Property="Width" Value="20"></Setter> | |||||
<Setter Property="Height" Value="22"></Setter> | |||||
<Setter Property="VerticalAlignment" Value="Top"></Setter> | |||||
<Setter Property="HorizontalAlignment" Value="Center"></Setter> | |||||
<Setter Property="Source" Value="/BPASmartClient.CustomResource;component/Image/功能列表.png"/> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="imagetop_产品制作" TargetType="Image"> | |||||
<Style.Setters> | |||||
<Setter Property="Width" Value="20"></Setter> | |||||
<Setter Property="Height" Value="22"></Setter> | |||||
<Setter Property="VerticalAlignment" Value="Top"></Setter> | |||||
<Setter Property="HorizontalAlignment" Value="Center"></Setter> | |||||
<Setter Property="Source" Value="/BPASmartClient.CustomResource;component/Image/产品制作.png"/> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="imagetop_L" TargetType="Image"> | <Style x:Key="imagetop_L" TargetType="Image"> | ||||
<Style.Setters> | <Style.Setters> | ||||
<Setter Property="Height" Value="80"></Setter> | <Setter Property="Height" Value="80"></Setter> | ||||
@@ -390,6 +420,26 @@ | |||||
</Style.Setters> | </Style.Setters> | ||||
</Style> | </Style> | ||||
<Style x:Key="borderPop_bg" TargetType="Border"> | |||||
<Style.Setters> | |||||
<Setter Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Pop_bg.png" /> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="border背景two" TargetType="Border"> | |||||
<Style.Setters> | |||||
<Setter Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/背景2.png" /> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="border窗体背景3" TargetType="Border"> | <Style x:Key="border窗体背景3" TargetType="Border"> | ||||
<Style.Setters> | <Style.Setters> | ||||
<Setter Property="Background"> | <Setter Property="Background"> | ||||
@@ -464,7 +514,6 @@ | |||||
<Style x:Key="border矩形" TargetType="Border"> | <Style x:Key="border矩形" TargetType="Border"> | ||||
<Style.Setters> | <Style.Setters> | ||||
<Setter Property="BorderThickness" Value="0.5"></Setter> | |||||
<Setter Property="Background"> | <Setter Property="Background"> | ||||
<Setter.Value> | <Setter.Value> | ||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | ||||
@@ -884,6 +933,161 @@ | |||||
</Style.Setters> | </Style.Setters> | ||||
</Style> | </Style> | ||||
<Style TargetType="{x:Type Separator}"> | |||||
<Setter Property="Height" Value="1"/> | |||||
<Setter Property="Margin" Value="0,4,0,4"/> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type Separator}"> | |||||
<Border > | |||||
<Border.Background> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" /> | |||||
</Border.Background> | |||||
</Border> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="CommonBtn_功能节点" TargetType="Button"> | |||||
<Style.Setters> | |||||
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | |||||
<Setter Property="Cursor" Value="Hand"></Setter> | |||||
<Setter Property="Margin" Value="10,5,10,5"></Setter> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<StackPanel x:Name="BD" Orientation="Horizontal"> | |||||
<Image Width="24" Margin="5" Source="/BPASmartClient.CustomResource;component/Image/临时模板.png"/> | |||||
<TextBlock Margin="10,0,0,0" x:Name="textBlock" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" Text="{TemplateBinding Content}" Foreground="#00c1c3" /> | |||||
<TextBlock x:Name="tex2tBlock" VerticalAlignment="Center" Visibility="Collapsed" FontSize="14" Text="{TemplateBinding Content}" Foreground="#4fade8" /> | |||||
</StackPanel> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Pop_bg.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="False"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="CommonBtn_产品制作" TargetType="Button"> | |||||
<Style.Setters> | |||||
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | |||||
<Setter Property="Cursor" Value="Hand"></Setter> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<StackPanel x:Name="BD" Margin="5"> | |||||
<Image Width="24" Margin="5,10,5,0" Source="/BPASmartClient.CustomResource;component/Image/产品制作.png"/> | |||||
<TextBlock x:Name="textBlock" Visibility="Collapsed" VerticalAlignment="Center" FontSize="14" Text="{TemplateBinding Content}" Foreground="#4fade8" /> | |||||
<Separator Margin="0,10,0,0"/> | |||||
</StackPanel> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Pop_bg.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="False"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="CommonBtn_功能列表" TargetType="Button"> | |||||
<Style.Setters> | |||||
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | |||||
<Setter Property="Cursor" Value="Hand"></Setter> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<StackPanel x:Name="BD" Margin="5"> | |||||
<Image Width="24" Margin="5,10,5,0" Source="/BPASmartClient.CustomResource;component/Image/功能列表.png"/> | |||||
<TextBlock x:Name="textBlock" Visibility="Collapsed" VerticalAlignment="Center" FontSize="14" Text="{TemplateBinding Content}" Foreground="#4fade8" /> | |||||
<Separator Margin="0,10,0,0"/> | |||||
</StackPanel> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Pop_bg.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="False"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style x:Key="CommonBtn_维护" TargetType="Button"> | |||||
<Style.Setters> | |||||
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | |||||
<Setter Property="Cursor" Value="Hand"></Setter> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<StackPanel x:Name="BD" Margin="5"> | |||||
<Image Width="24" Margin="5,10,5,0" Source="/BPASmartClient.CustomResource;component/Image/维护.png"/> | |||||
<TextBlock x:Name="textBlock" Visibility="Collapsed" VerticalAlignment="Center" FontSize="14" Text="{TemplateBinding Content}" Foreground="#4fade8" /> | |||||
<Separator Margin="0,10,0,0"/> | |||||
</StackPanel> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Pop_bg.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="False"> | |||||
<Setter TargetName="BD" Property="Background"> | |||||
<Setter.Value> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style.Setters> | |||||
</Style> | |||||
<Style TargetType="Button"> | <Style TargetType="Button"> | ||||
<Style.Setters> | <Style.Setters> | ||||
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | <Setter Property="VerticalContentAlignment" Value="Center"></Setter> | ||||
@@ -0,0 +1,155 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.IO; | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Markup; | |||||
using System.Xml; | |||||
namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
{ | |||||
public class DesignerCanvas :Canvas | |||||
{ | |||||
// start point of the rubberband drag operation | |||||
private Point? rubberbandSelectionStartPoint = null; | |||||
// keep track of selected items | |||||
private List<ISelectable> selectedItems; | |||||
public List<ISelectable> SelectedItems | |||||
{ | |||||
get | |||||
{ | |||||
if (selectedItems == null) | |||||
selectedItems = new List<ISelectable>(); | |||||
return selectedItems; | |||||
} | |||||
set | |||||
{ | |||||
selectedItems = value; | |||||
} | |||||
} | |||||
public DesignerCanvas() | |||||
{ | |||||
this.AllowDrop = true; | |||||
} | |||||
protected override void OnMouseDown(MouseButtonEventArgs e) | |||||
{ | |||||
base.OnMouseDown(e); | |||||
if (e.Source == this) | |||||
{ | |||||
// in case that this click is the start for a | |||||
// drag operation we cache the start point | |||||
this.rubberbandSelectionStartPoint = new Point?(e.GetPosition(this)); | |||||
// if you click directly on the canvas all | |||||
// selected items are 'de-selected' | |||||
foreach (ISelectable item in SelectedItems) | |||||
item.IsSelected = false; | |||||
selectedItems.Clear(); | |||||
e.Handled = true; | |||||
} | |||||
} | |||||
protected override void OnMouseMove(MouseEventArgs e) | |||||
{ | |||||
base.OnMouseMove(e); | |||||
// if mouse button is not pressed we have no drag operation, ... | |||||
if (e.LeftButton != MouseButtonState.Pressed) | |||||
this.rubberbandSelectionStartPoint = null; | |||||
// ... but if mouse button is pressed and start | |||||
// point value is set we do have one | |||||
if (this.rubberbandSelectionStartPoint.HasValue) | |||||
{ | |||||
// create rubberband adorner | |||||
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this); | |||||
if (adornerLayer != null) | |||||
{ | |||||
RubberbandAdorner adorner = new RubberbandAdorner(this,rubberbandSelectionStartPoint); | |||||
if (adorner != null) | |||||
{ | |||||
adornerLayer.Add(adorner); | |||||
} | |||||
} | |||||
} | |||||
e.Handled = true; | |||||
} | |||||
protected override void OnDrop(DragEventArgs e) | |||||
{ | |||||
base.OnDrop(e); | |||||
DragObject dragObject = e.Data.GetData(typeof(DragObject)) as DragObject; | |||||
if (dragObject != null && !String.IsNullOrEmpty(dragObject.Xaml)) | |||||
{ | |||||
NodeButton newItem = null; | |||||
Object content = XamlReader.Load(XmlReader.Create(new StringReader(dragObject.Xaml))); | |||||
if (content != null) | |||||
{ | |||||
newItem = new NodeButton(dragObject.text,dragObject.tag); | |||||
//newItem.Content = content; | |||||
Point position = e.GetPosition(this); | |||||
if (dragObject.DesiredSize.HasValue) | |||||
{ | |||||
Size desiredSize = dragObject.DesiredSize.Value; | |||||
newItem.Width = desiredSize.Width; | |||||
newItem.Height = desiredSize.Height; | |||||
DesignerCanvas.SetLeft(newItem,Math.Max(0,position.X - newItem.Width / 2)); | |||||
DesignerCanvas.SetTop(newItem,Math.Max(0,position.Y - newItem.Height / 2)); | |||||
} | |||||
else | |||||
{ | |||||
DesignerCanvas.SetLeft(newItem,Math.Max(0,position.X)); | |||||
DesignerCanvas.SetTop(newItem,Math.Max(0,position.Y)); | |||||
} | |||||
this.Children.Add(newItem); | |||||
//update selection | |||||
//foreach (ISelectable item in this.SelectedItems) | |||||
// item.IsSelected = false; | |||||
//SelectedItems.Clear(); | |||||
//newItem.IsSelected = true; | |||||
//this.SelectedItems.Add(newItem); | |||||
} | |||||
e.Handled = true; | |||||
} | |||||
} | |||||
protected override Size MeasureOverride(Size constraint) | |||||
{ | |||||
Size size = new Size(); | |||||
foreach (UIElement element in base.Children) | |||||
{ | |||||
double left = Canvas.GetLeft(element); | |||||
double top = Canvas.GetTop(element); | |||||
left = double.IsNaN(left) ? 0 : left; | |||||
top = double.IsNaN(top) ? 0 : top; | |||||
//measure desired size for each child | |||||
element.Measure(constraint); | |||||
Size desiredSize = element.DesiredSize; | |||||
if (!double.IsNaN(desiredSize.Width) && !double.IsNaN(desiredSize.Height)) | |||||
{ | |||||
size.Width = Math.Max(size.Width,left + desiredSize.Width); | |||||
size.Height = Math.Max(size.Height,top + desiredSize.Height); | |||||
} | |||||
} | |||||
// add margin | |||||
size.Width += 10; | |||||
size.Height += 10; | |||||
return size; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,32 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
{ | |||||
// Common interface for items that can be selected | |||||
// on the DesignerCanvas; used by DesignerItem and Connection | |||||
public interface ISelectable | |||||
{ | |||||
bool IsSelected { get; set; } | |||||
} | |||||
// Wraps info of the dragged object into a class | |||||
public class DragObject | |||||
{ | |||||
// Xaml string that represents the serialized content | |||||
public String Xaml { get; set; } | |||||
// Defines width and height of the DesignerItem | |||||
// when this DragObject is dropped on the DesignerCanvas | |||||
public Size? DesiredSize { get; set; } | |||||
public string text { get; set; } | |||||
public string tag { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,18 @@ | |||||
<UserControl x:Class="BPASmartClient.CustomResource.UserControls.DeCanvas.NodeButton" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls.DeCanvas" | |||||
mc:Ignorable="d" | |||||
d:DesignHeight="44" d:DesignWidth="200"> | |||||
<UserControl.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</UserControl.Resources> | |||||
<Button x:Name="button" PreviewMouseDown="Button_PreviewMouseDown" MouseMove="Button_MouseMove" AllowDrop="True" Style="{DynamicResource CommonBtn_功能节点}" Cursor="Hand" Content="冰淇淋机器"/> | |||||
</UserControl> |
@@ -0,0 +1,78 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Data; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Markup; | |||||
using System.Windows.Media; | |||||
using System.Windows.Media.Imaging; | |||||
using System.Windows.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
{ | |||||
/// <summary> | |||||
/// NodeButton.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class NodeButton :UserControl | |||||
{ | |||||
public bool IsSelected { get; set; } | |||||
protected Point m_DragStartPoint; | |||||
protected bool m_IsDraging = false; | |||||
public NodeButton() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
public NodeButton(string text,string tag) | |||||
{ | |||||
InitializeComponent(); | |||||
button.Content = text; | |||||
button.Tag = tag; | |||||
} | |||||
private void Button_PreviewMouseDown(object sender,MouseButtonEventArgs e) | |||||
{ | |||||
e.Handled = true; | |||||
base.OnPreviewMouseDown(e); | |||||
m_DragStartPoint = e.GetPosition(null); | |||||
} | |||||
private void Button_MouseMove(object sender,MouseEventArgs e) | |||||
{ | |||||
try | |||||
{ | |||||
base.OnMouseMove(e); | |||||
if (e.LeftButton == MouseButtonState.Pressed && !m_IsDraging) | |||||
{ | |||||
Point position = e.GetPosition(null); | |||||
} | |||||
if (e.LeftButton == MouseButtonState.Pressed && !m_IsDraging) | |||||
{ | |||||
m_IsDraging = true; | |||||
// XamlWriter.Save() has limitations in exactly what is serialized, | |||||
// see SDK documentation; short term solution only; | |||||
string xamlString = XamlWriter.Save(this.Content); | |||||
DragObject dataObject = new DragObject(); | |||||
dataObject.Xaml = xamlString; | |||||
dataObject.text = button.Content.ToString(); | |||||
dataObject.DesiredSize = new Size(200,44); | |||||
DragDrop.DoDragDrop(this,dataObject,DragDropEffects.Copy); | |||||
e.Handled = true; | |||||
m_IsDraging = false; | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,92 @@ | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Media; | |||||
namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
{ | |||||
public class RubberbandAdorner :Adorner | |||||
{ | |||||
private Point? startPoint; | |||||
private Point? endPoint; | |||||
private Pen rubberbandPen; | |||||
private DesignerCanvas designerCanvas; | |||||
public RubberbandAdorner(DesignerCanvas designerCanvas,Point? dragStartPoint) | |||||
: base(designerCanvas) | |||||
{ | |||||
this.designerCanvas = designerCanvas; | |||||
this.startPoint = dragStartPoint; | |||||
rubberbandPen = new Pen(Brushes.LightSlateGray,1); | |||||
rubberbandPen.DashStyle = new DashStyle(new double[] { 2 },1); | |||||
} | |||||
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e) | |||||
{ | |||||
if (e.LeftButton == MouseButtonState.Pressed) | |||||
{ | |||||
if (!this.IsMouseCaptured) | |||||
this.CaptureMouse(); | |||||
endPoint = e.GetPosition(this); | |||||
UpdateSelection(); | |||||
this.InvalidateVisual(); | |||||
} | |||||
else | |||||
{ | |||||
if (this.IsMouseCaptured) this.ReleaseMouseCapture(); | |||||
} | |||||
e.Handled = true; | |||||
} | |||||
protected override void OnMouseUp(System.Windows.Input.MouseButtonEventArgs e) | |||||
{ | |||||
// release mouse capture | |||||
if (this.IsMouseCaptured) this.ReleaseMouseCapture(); | |||||
// remove this adorner from adorner layer | |||||
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.designerCanvas); | |||||
if (adornerLayer != null) | |||||
adornerLayer.Remove(this); | |||||
e.Handled = true; | |||||
} | |||||
protected override void OnRender(DrawingContext dc) | |||||
{ | |||||
base.OnRender(dc); | |||||
// without a background the OnMouseMove event would not be fired ! | |||||
// Alternative: implement a Canvas as a child of this adorner, like | |||||
// the ConnectionAdorner does. | |||||
dc.DrawRectangle(Brushes.Transparent,null,new Rect(RenderSize)); | |||||
if (this.startPoint.HasValue && this.endPoint.HasValue) | |||||
dc.DrawRectangle(Brushes.Transparent,rubberbandPen,new Rect(this.startPoint.Value,this.endPoint.Value)); | |||||
} | |||||
private void UpdateSelection() | |||||
{ | |||||
foreach (ISelectable item in designerCanvas.SelectedItems) | |||||
item.IsSelected = false; | |||||
designerCanvas.SelectedItems.Clear(); | |||||
Rect rubberBand = new Rect(startPoint.Value,endPoint.Value); | |||||
foreach (Control item in designerCanvas.Children) | |||||
{ | |||||
Rect itemRect = VisualTreeHelper.GetDescendantBounds(item); | |||||
Rect itemBounds = item.TransformToAncestor(designerCanvas).TransformBounds(itemRect); | |||||
if (rubberBand.Contains(itemBounds) && item is ISelectable) | |||||
{ | |||||
ISelectable selectableItem = item as ISelectable; | |||||
selectableItem.IsSelected = true; | |||||
designerCanvas.SelectedItems.Add(selectableItem); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -4,9 +4,64 @@ | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||||
xmlns:local="clr-namespace:BPASmartClient.Control" | xmlns:local="clr-namespace:BPASmartClient.Control" | ||||
xmlns:s="clr-namespace:BPASmartClient.CustomResource.UserControls.DeCanvas;assembly=BPASmartClient.CustomResource" | |||||
mc:Ignorable="d" | mc:Ignorable="d" | ||||
d:DesignHeight="450" d:DesignWidth="800"> | d:DesignHeight="450" d:DesignWidth="800"> | ||||
<Grid> | |||||
<Label FontSize="100" >业务流程编排界面</Label> | |||||
<UserControl.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</UserControl.Resources> | |||||
<Grid Margin="10"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="200"/> | |||||
<ColumnDefinition Width="*"/> | |||||
</Grid.ColumnDefinitions> | |||||
<Border Style="{DynamicResource border阴影边框扩展}" BorderThickness="0" BorderBrush="#00eaff"/> | |||||
<Border Grid.Column="1" Style="{DynamicResource border阴影边框扩展}" BorderThickness="0" BorderBrush="#00eaff"/> | |||||
<Border Grid.Column="2" Style="{DynamicResource border阴影边框扩展}" BorderThickness="0" BorderBrush="#00eaff"/> | |||||
<StackPanel> | |||||
<Button Margin="5" Style="{DynamicResource CommonBtn_功能列表}" ToolTip="项目下所有产品列表"/> | |||||
<Button Margin="5" Style="{DynamicResource CommonBtn_产品制作}" ToolTip="节点是可以组成产品的原子功能"/> | |||||
<Button Margin="5" Style="{DynamicResource CommonBtn_维护}" ToolTip="预留功能" Cursor="Hand"/> | |||||
</StackPanel> | |||||
<Grid Grid.Column="1"> | |||||
<StackPanel> | |||||
<Expander Header="设备节点" IsExpanded="True" Foreground="#addbff"> | |||||
<StackPanel x:Name="Send"> | |||||
</StackPanel> | |||||
</Expander> | |||||
<Expander Header="协议节点" IsExpanded="True" Foreground="#addbff"> | |||||
<StackPanel > | |||||
<Button Style="{DynamicResource CommonBtn_功能节点}" ToolTip="项目下所有产品列表" Cursor="Hand" Content="HTTP"/> | |||||
<Button Style="{DynamicResource CommonBtn_功能节点}" ToolTip="项目下所有产品列表" Cursor="Hand" Content="Modbus"/> | |||||
<Button Style="{DynamicResource CommonBtn_功能节点}" ToolTip="项目下所有产品列表" Cursor="Hand" Content="MQTT"/> | |||||
<Button Style="{DynamicResource CommonBtn_功能节点}" ToolTip="项目下所有产品列表" Cursor="Hand" Content="SerialPort"/> | |||||
<Button Style="{DynamicResource CommonBtn_功能节点}" ToolTip="项目下所有产品列表" Cursor="Hand" Content="Socket"/> | |||||
</StackPanel> | |||||
</Expander> | |||||
</StackPanel> | |||||
</Grid> | |||||
<Grid Grid.Column="2"> | |||||
<!--<WrapPanel x:Name="canvas" > | |||||
</WrapPanel>--> | |||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> | |||||
<s:DesignerCanvas Background="Transparent" Margin="10"/> | |||||
</ScrollViewer> | |||||
</Grid> | |||||
</Grid> | </Grid> | ||||
</UserControl> | </UserControl> |
@@ -1,4 +1,5 @@ | |||||
using System; | |||||
using BPASmartClient.CustomResource.UserControls.DeCanvas; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
@@ -8,6 +9,7 @@ using System.Windows.Controls; | |||||
using System.Windows.Data; | using System.Windows.Data; | ||||
using System.Windows.Documents; | using System.Windows.Documents; | ||||
using System.Windows.Input; | using System.Windows.Input; | ||||
using System.Windows.Markup; | |||||
using System.Windows.Media; | using System.Windows.Media; | ||||
using System.Windows.Media.Imaging; | using System.Windows.Media.Imaging; | ||||
using System.Windows.Navigation; | using System.Windows.Navigation; | ||||
@@ -20,9 +22,20 @@ namespace BPASmartClient.Control | |||||
/// </summary> | /// </summary> | ||||
public partial class BusinessOrchestrationView :UserControl | public partial class BusinessOrchestrationView :UserControl | ||||
{ | { | ||||
// caches the start point of the drag operation | |||||
public BusinessOrchestrationView() | public BusinessOrchestrationView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
Send.Children.Add(new NodeButton("伽乐美咖啡机","")); | |||||
Send.Children.Add(new NodeButton("冰淇淋机器","")); | |||||
Send.Children.Add(new NodeButton("乐白机器人","")); | |||||
Send.Children.Add(new NodeButton("单片机","")); | |||||
} | } | ||||
} | } | ||||
} | } |