StepGroupEditView.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Parameter.StepGroupEditView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Parameter"
  7. mc:Ignorable="d"
  8. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  9. xmlns:cal="clr-namespace:Caliburn.Micro"
  10. Height="768" Width="1024" Background="#DAE5F1">
  11. <UserControl.Resources>
  12. <Style BasedOn="{StaticResource ExModifyScrollBar}" TargetType="ScrollBar"/>
  13. </UserControl.Resources>
  14. <Grid>
  15. <Grid.RowDefinitions>
  16. <RowDefinition></RowDefinition>
  17. <RowDefinition Height="100"></RowDefinition>
  18. </Grid.RowDefinitions>
  19. <ListBox ItemsSource="{Binding StepIdList, UpdateSourceTrigger=PropertyChanged}">
  20. <ListBox.ItemsPanel>
  21. <ItemsPanelTemplate>
  22. <UniformGrid Columns="5" Rows="40"></UniformGrid>
  23. </ItemsPanelTemplate>
  24. </ListBox.ItemsPanel>
  25. <ListBox.ItemTemplate>
  26. <DataTemplate>
  27. <Border BorderBrush="#ccc" BorderThickness="1" Margin="1">
  28. <CheckBox Foreground="#BFBFBF" Content="{Binding Display}" FontSize="20" Width="180" Margin="5,20,0,0" IsChecked="{Binding IsExpanded, Mode=TwoWay, Delay=10}" >
  29. <!--<CheckBox.Content>
  30. <Grid Margin="-5,2,0,0">
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="Auto"/>
  33. <ColumnDefinition Width="Auto"/>
  34. </Grid.ColumnDefinitions>
  35. <Border Grid.Column="0" HorizontalAlignment="Center" Width="40">
  36. <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
  37. </Border>
  38. <Label Tag="{Binding CurrentValue }" HorizontalContentAlignment="Center" Grid.Column="1" Width="90" Content="{Binding CurrentValue}" Height="30" >
  39. </Label>
  40. </Grid>
  41. </CheckBox.Content>-->
  42. <CheckBox.Resources>
  43. <Style x:Key="FocusVisual">
  44. <Setter Property="Control.Template">
  45. <Setter.Value>
  46. <ControlTemplate>
  47. <Rectangle SnapsToDevicePixels="true"
  48. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  49. StrokeDashArray="1 2"
  50. StrokeThickness="1" />
  51. </ControlTemplate>
  52. </Setter.Value>
  53. </Setter>
  54. </Style>
  55. <SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF" />
  56. <SolidColorBrush x:Key="OptionMark.Static.Border" Color="#FF707070" />
  57. <Style x:Key="OptionMarkFocusVisual">
  58. <Setter Property="Control.Template">
  59. <Setter.Value>
  60. <ControlTemplate>
  61. <Rectangle SnapsToDevicePixels="true"
  62. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  63. StrokeDashArray="1 2"
  64. StrokeThickness="1" />
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. <SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="#FFF3F9FF" />
  70. <SolidColorBrush x:Key="OptionMark.MouseOver.Border" Color="#FF5593FF" />
  71. <SolidColorBrush x:Key="OptionMark.MouseOver.Glyph" Color="#FF212121" />
  72. <SolidColorBrush x:Key="OptionMark.Disabled.Background" Color="#FFE6E6E6" />
  73. <SolidColorBrush x:Key="OptionMark.Disabled.Border" Color="#FFBCBCBC" />
  74. <SolidColorBrush x:Key="OptionMark.Disabled.Glyph" Color="#FF707070" />
  75. <SolidColorBrush x:Key="OptionMark.Pressed.Background" Color="#FFD9ECFF" />
  76. <SolidColorBrush x:Key="OptionMark.Pressed.Border" Color="#FF3C77DD" />
  77. <SolidColorBrush x:Key="OptionMark.Pressed.Glyph" Color="#FF212121" />
  78. <SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="#FF212121" />
  79. <Style TargetType="{x:Type CheckBox}">
  80. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  81. <Setter Property="Background" Value="{StaticResource OptionMark.Static.Background}" />
  82. <Setter Property="BorderBrush" Value="{StaticResource OptionMark.Static.Border}" />
  83. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  84. <Setter Property="BorderThickness" Value="1" />
  85. <Setter Property="Template">
  86. <Setter.Value>
  87. <ControlTemplate TargetType="{x:Type CheckBox}">
  88. <Grid Background="Transparent" SnapsToDevicePixels="True">
  89. <Grid.ColumnDefinitions>
  90. <ColumnDefinition Width="Auto" />
  91. <ColumnDefinition Width="*" />
  92. </Grid.ColumnDefinitions>
  93. <!-- Hide the default checkbox -->
  94. <Border Visibility="Collapsed"
  95. x:Name="checkBoxBorder"
  96. Margin="1"
  97. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  98. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  99. Background="{TemplateBinding Background}"
  100. BorderBrush="{TemplateBinding BorderBrush}"
  101. BorderThickness="{TemplateBinding BorderThickness}">
  102. <Grid x:Name="markGrid" Width="27" Height="27">
  103. <Path x:Name="optionMark"
  104. Margin="1"
  105. Data="F1 M 9.97498,1.22334L 4.6983,9.09834L 4.52164,9.09834L 0,5.19331L 1.27664,3.52165L 4.255,6.08833L 8.33331,1.52588e-005L 9.97498,1.22334 Z "
  106. Fill="{StaticResource OptionMark.Static.Glyph}"
  107. Opacity="0"
  108. Stretch="Uniform" />
  109. <Rectangle x:Name="indeterminateMark"
  110. Margin="2"
  111. Fill="{StaticResource OptionMark.Static.Glyph}"
  112. Opacity="0" />
  113. </Grid>
  114. </Border>
  115. <ContentPresenter x:Name="contentPresenter"
  116. Grid.Column="1"
  117. Margin="{TemplateBinding Padding}"
  118. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  119. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  120. Focusable="False"
  121. RecognizesAccessKey="True"
  122. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  123. </Grid>
  124. <ControlTemplate.Triggers>
  125. <Trigger Property="HasContent" Value="true">
  126. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  127. <Setter Property="Padding" Value="4,-1,0,0" />
  128. </Trigger>
  129. <Trigger Property="IsMouseOver" Value="true">
  130. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.MouseOver.Background}" />
  131. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.MouseOver.Border}" />
  132. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
  133. <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
  134. </Trigger>
  135. <Trigger Property="IsEnabled" Value="false">
  136. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Disabled.Background}" />
  137. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Disabled.Border}" />
  138. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
  139. <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
  140. </Trigger>
  141. <Trigger Property="IsPressed" Value="true">
  142. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
  143. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
  144. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  145. <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  146. </Trigger>
  147. <Trigger Property="IsChecked" Value="true">
  148. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  149. <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
  150. <!-- Highlight text when checked -->
  151. <Setter TargetName="contentPresenter" Property="TextBlock.Foreground" Value="Black" />
  152. </Trigger>
  153. <Trigger Property="IsChecked" Value="{x:Null}">
  154. <Setter TargetName="optionMark" Property="Opacity" Value="0" />
  155. <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
  156. </Trigger>
  157. </ControlTemplate.Triggers>
  158. </ControlTemplate>
  159. </Setter.Value>
  160. </Setter>
  161. </Style>
  162. </CheckBox.Resources>
  163. </CheckBox>
  164. </Border>
  165. </DataTemplate>
  166. </ListBox.ItemTemplate>
  167. </ListBox>
  168. <StackPanel Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal">
  169. <Button Width="100" Height="50" Margin="0,0,20,0" Content="Save" >
  170. <i:Interaction.Triggers>
  171. <i:EventTrigger EventName="Click">
  172. <cal:ActionMessage MethodName="Save">
  173. </cal:ActionMessage>
  174. </i:EventTrigger>
  175. </i:Interaction.Triggers>
  176. </Button>
  177. <Button Width="100" Height="50" Content="Cancle" >
  178. <i:Interaction.Triggers>
  179. <i:EventTrigger EventName="Click">
  180. <cal:ActionMessage MethodName="Cancle">
  181. </cal:ActionMessage>
  182. </i:EventTrigger>
  183. </i:Interaction.Triggers>
  184. </Button>
  185. </StackPanel>
  186. </Grid>
  187. </UserControl>