RuleForm.xaml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <UserControl x:Class="GDNXFD.Alert.Config.Views.RuleForm"
  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:val="clr-namespace:GDNXFD.Alert.Config.Validations"
  7. xmlns:control="clr-namespace:GDNXFD.Alert.Config.Controls"
  8. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  9. xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"
  10. mc:Ignorable="d"
  11. d:DesignHeight="666" d:DesignWidth="1024" Background="{StaticResource module-background-color-brush }" >
  12. <Grid >
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="24px"></RowDefinition>
  15. <RowDefinition Height="auto"></RowDefinition>
  16. <RowDefinition Height="*"></RowDefinition>
  17. <RowDefinition Height="auto"></RowDefinition>
  18. <RowDefinition Height="50px"></RowDefinition>
  19. </Grid.RowDefinitions>
  20. <!--导航-->
  21. <Grid Grid.Row="0" Background="{StaticResource second-background-color-brush }" >
  22. <Button Grid.Row="0" Style="{StaticResource BackButtonStyle}" Width="18" Height="18"
  23. ToolTip="{Binding Back, Source={StaticResource Provider}, Mode=OneWay}"
  24. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.CancelCommand }" >
  25. <Image Source="/Resources/Images/back.png" Stretch="Uniform" Width="15" Height="15"></Image>
  26. </Button>
  27. <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource FormTitleStyle}">
  28. <Run Text="{Binding FormTitle, Mode=OneWay}" />
  29. </TextBlock>
  30. </Grid>
  31. <Border Grid.Row="1" IsEnabled="{Binding IsFormEditable}" Style="{StaticResource FormBorderStyle}" Background="{StaticResource second-background-color-brush }" >
  32. <Grid>
  33. <Grid.RowDefinitions>
  34. <RowDefinition></RowDefinition>
  35. <RowDefinition></RowDefinition>
  36. </Grid.RowDefinitions>
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="*"></ColumnDefinition>
  39. <ColumnDefinition Width="*"></ColumnDefinition>
  40. <ColumnDefinition Width="*"></ColumnDefinition>
  41. <ColumnDefinition Width="*"></ColumnDefinition>
  42. <ColumnDefinition Width="*"></ColumnDefinition>
  43. </Grid.ColumnDefinitions>
  44. <TextBlock Text="统一编码" Grid.Row="0" Grid.Column="0"
  45. Style="{StaticResource LabelStyle}" Margin="0"></TextBlock>
  46. <TextBox Style="{StaticResource TextBox}"
  47. Grid.Row="1" Grid.Column="0" IsEnabled="{Binding IsIdEditable}" >
  48. <TextBox.Text>
  49. <Binding Path="AlertRule.Id" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnSourceUpdated="True">
  50. <Binding.ValidationRules>
  51. <val:AlertRuleIDValidationRule ValidatesOnTargetUpdated="True"></val:AlertRuleIDValidationRule>
  52. </Binding.ValidationRules>
  53. </Binding>
  54. </TextBox.Text>
  55. </TextBox>
  56. <TextBlock Text="规则名称" Grid.Row="0" Grid.Column="1" Margin="10,0,0,0"
  57. Style="{StaticResource LabelStyle}"></TextBlock>
  58. <TextBox Style="{StaticResource TextBox}" Grid.Row="1" Grid.Column="1" Margin="10,0,0,0" >
  59. <TextBox.Text>
  60. <Binding Path="AlertRule.Name" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnSourceUpdated="True">
  61. <Binding.ValidationRules>
  62. <val:RequiredValidationRule ValidatesOnTargetUpdated="True"></val:RequiredValidationRule>
  63. </Binding.ValidationRules>
  64. </Binding>
  65. </TextBox.Text>
  66. </TextBox>
  67. <TextBlock Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="2"
  68. Margin="10,0,0,0" Text="报警级别"></TextBlock>
  69. <ComboBox VerticalAlignment="Center" Style="{StaticResource ComboBox}" Grid.Row="1" Grid.Column="2"
  70. Margin="10,0,0,0" ItemsSource="{Binding LevelList}" DisplayMemberPath="Name">
  71. <ComboBox.SelectedItem>
  72. <Binding Path="SelectedAlertLevel" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
  73. <Binding.ValidationRules>
  74. <val:SelectedAlertLevelValidationRule ValidatesOnTargetUpdated="True" ValidationStep="UpdatedValue"></val:SelectedAlertLevelValidationRule>
  75. </Binding.ValidationRules>
  76. </Binding>
  77. </ComboBox.SelectedItem>
  78. </ComboBox>
  79. <TextBlock Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="3"
  80. Margin="10,0,0,0" Text="报警类型"></TextBlock>
  81. <ComboBox VerticalAlignment="Center" Style="{StaticResource ComboBox}" Grid.Row="1" Grid.Column="3"
  82. Margin="10,0,0,0" ItemsSource="{Binding CategoryList}" DisplayMemberPath="Name">
  83. <ComboBox.SelectedItem>
  84. <Binding Path="SelectedAlertCategory" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
  85. <Binding.ValidationRules>
  86. <val:SelectedAlertCategoryValidationRule ValidatesOnTargetUpdated="True" ValidationStep="UpdatedValue"></val:SelectedAlertCategoryValidationRule>
  87. </Binding.ValidationRules>
  88. </Binding>
  89. </ComboBox.SelectedItem>
  90. <i:Interaction.Triggers>
  91. <i:EventTrigger EventName="SelectionChanged">
  92. <cmd:EventToCommand Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.CategorySelectionChangedCommand }"
  93. PassEventArgsToCommand="True" />
  94. </i:EventTrigger>
  95. </i:Interaction.Triggers>
  96. </ComboBox>
  97. <TextBlock Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="4"
  98. Margin="10,0,0,0" Text="是否启用"/>
  99. <StackPanel Margin="10,0,0,0" Grid.Row="1" Grid.Column="4" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
  100. <RadioButton Style="{StaticResource FormRadios}" Margin="5 0 0 0" IsChecked="{Binding Path=AlertRuleEnabled}"
  101. Content="启 用"/>
  102. <RadioButton Style="{StaticResource FormRadios}" Margin="20 0 0 0" IsChecked="{Binding Path=AlertRuleDisabled}"
  103. Content="停 用"/>
  104. </StackPanel>
  105. </Grid>
  106. </Border>
  107. <Border Grid.Row="2" Style="{StaticResource FormBorderStyle}" IsEnabled="{Binding IsFormEditable}" Background="{StaticResource second-background-color-brush }" >
  108. <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
  109. <Grid.RowDefinitions>
  110. <RowDefinition MaxHeight="300" ></RowDefinition>
  111. <RowDefinition Height="*"></RowDefinition>
  112. <RowDefinition Height="10"></RowDefinition>
  113. </Grid.RowDefinitions>
  114. <Grid.ColumnDefinitions>
  115. <ColumnDefinition Width="*"></ColumnDefinition>
  116. <ColumnDefinition Width="80"></ColumnDefinition>
  117. </Grid.ColumnDefinitions>
  118. <!--<TextBlock Grid.Row="2" Grid.Column="0" Text="表达式" Style="{StaticResource LabelStyle}"></TextBlock>-->
  119. <!--<Button Grid.Row="2" Grid.Column="1" Style="{StaticResource ConfirmButtonStyle}" Height="20" Width="80"
  120. HorizontalAlignment="Left" VerticalAlignment="Bottom"
  121. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.CheckExpressionCommand }"
  122. ToolTip="{Binding UploadFile, Source={StaticResource Provider}, Mode=OneWay}">
  123. <TextBlock Text="验 证" Style="{StaticResource ButtonLabelStyle}"></TextBlock>
  124. </Button>-->
  125. <TextBox x:Name="txtExpression" Grid.Row="1" Grid.ColumnSpan="2"
  126. TextWrapping="Wrap" AcceptsReturn="True" Padding="3" VerticalContentAlignment="Top"
  127. MaxLength="3999" MinHeight="80" >
  128. <TextBox.Text>
  129. <Binding Path="AlertRule.Expression" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnSourceUpdated="True">
  130. <Binding.ValidationRules>
  131. <val:RequiredValidationRule ValidatesOnTargetUpdated="True"></val:RequiredValidationRule>
  132. </Binding.ValidationRules>
  133. </Binding>
  134. </TextBox.Text>
  135. </TextBox>
  136. <Border Grid.Row="0" Grid.ColumnSpan="2" Visibility="{Binding ShowExpressionEditor, Converter={StaticResource BooleanToVisibilityConverter}}"
  137. BorderThickness="1" BorderBrush="Gray" >
  138. <Grid MaxHeight="300" MinHeight="100">
  139. <Grid.RowDefinitions>
  140. <RowDefinition Height="20" ></RowDefinition>
  141. <RowDefinition Height="*"></RowDefinition>
  142. </Grid.RowDefinitions>
  143. <Grid.ColumnDefinitions>
  144. <ColumnDefinition></ColumnDefinition>
  145. <ColumnDefinition Width="3"></ColumnDefinition>
  146. <ColumnDefinition></ColumnDefinition>
  147. <ColumnDefinition Width="3"></ColumnDefinition>
  148. <ColumnDefinition></ColumnDefinition>
  149. <ColumnDefinition Width="3"></ColumnDefinition>
  150. <ColumnDefinition></ColumnDefinition>
  151. <ColumnDefinition Width="3"></ColumnDefinition>
  152. <ColumnDefinition></ColumnDefinition>
  153. </Grid.ColumnDefinitions>
  154. <GridSplitter Grid.Column="1" Grid.RowSpan="2" Width="2" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#dddddd" />
  155. <GridSplitter Grid.Column="3" Grid.RowSpan="2" Width="2" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#dddddd" />
  156. <GridSplitter Grid.Column="5" Grid.RowSpan="2" Width="2" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#dddddd" />
  157. <GridSplitter Grid.Column="7" Grid.RowSpan="2" Width="2" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#dddddd" />
  158. <!--范围-->
  159. <StackPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Orientation="Vertical" Margin="6 0 6 0" VerticalAlignment="Top">
  160. <TextBlock Grid.Row="0" Text="风场" Style="{StaticResource LabelStyle}"
  161. Visibility="{Binding ShowStation, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
  162. <control:MultiSelectComboBox x:Name="mcStation"
  163. Visibility="{Binding ShowStation, Converter={StaticResource BooleanToVisibilityConverter}}"
  164. ItemsSource="{Binding ItemsStation}" SelectedItems="{Binding SelectedItemsStation}" >
  165. <i:Interaction.Triggers>
  166. <i:EventTrigger EventName="SelectionChanged">
  167. <cmd:EventToCommand Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.StationSelectionChangedCommand }"
  168. PassEventArgsToCommand="True" />
  169. </i:EventTrigger>
  170. </i:Interaction.Triggers>
  171. </control:MultiSelectComboBox>
  172. <TextBlock Grid.Row="0" Text="风机类型" Style="{StaticResource LabelStyle}"
  173. Visibility="{Binding ShowModel, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
  174. <control:MultiSelectComboBox x:Name="mcModel"
  175. Visibility="{Binding ShowModel, Converter={StaticResource BooleanToVisibilityConverter}}"
  176. ItemsSource="{Binding ItemsModel}" SelectedItems="{Binding SelectedItemsModel}" >
  177. <i:Interaction.Triggers>
  178. <i:EventTrigger EventName="SelectionChanged">
  179. <cmd:EventToCommand Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.ModelSelectionChangedCommand }"
  180. PassEventArgsToCommand="True" />
  181. </i:EventTrigger>
  182. </i:Interaction.Triggers>
  183. </control:MultiSelectComboBox>
  184. <TextBlock Grid.Row="0" Text="风机" Style="{StaticResource LabelStyle}"
  185. Visibility="{Binding ShowWindturbine, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
  186. <control:MultiSelectComboBox x:Name="mcWindturbine"
  187. Visibility="{Binding ShowWindturbine, Converter={StaticResource BooleanToVisibilityConverter}}"
  188. ItemsSource="{Binding ItemsWindturbine,Mode=TwoWay}" SelectedItems="{Binding SelectedItemsWindturbine, Mode=TwoWay}" />
  189. <TextBlock Grid.Row="0" Text="工程" Style="{StaticResource LabelStyle}"
  190. Visibility="{Binding ShowProject, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
  191. <control:MultiSelectComboBox x:Name="mcProject"
  192. Visibility="{Binding ShowProject, Converter={StaticResource BooleanToVisibilityConverter}}"
  193. ItemsSource="{Binding ItemsProject}" SelectedItems="{Binding SelectedItemsProject}" />
  194. <TextBlock Grid.Row="0" Text="线路" Style="{StaticResource LabelStyle}"
  195. Visibility="{Binding ShowLine, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
  196. <control:MultiSelectComboBox x:Name="mcLine"
  197. Visibility="{Binding ShowLine, Converter={StaticResource BooleanToVisibilityConverter}}"
  198. ItemsSource="{Binding ItemsLine}" SelectedItems="{Binding SelectedItemsLine}" />
  199. </StackPanel>
  200. <!--AI测点-->
  201. <Grid Grid.Row="0" Grid.Column="2">
  202. <Grid.ColumnDefinitions>
  203. <ColumnDefinition Width="70"></ColumnDefinition>
  204. <ColumnDefinition Width="*"></ColumnDefinition>
  205. </Grid.ColumnDefinitions>
  206. <TextBlock Grid.Column="0" Style="{StaticResource LabelStyle}" Text="AI测点" />
  207. <!--规则列表检索条件-->
  208. <control:TextBoxKeyboard Grid.Column="1" MaxLength="50" Style="{StaticResource TextBox}"
  209. Text="{Binding AIFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  210. Template="{DynamicResource SearchTextBoxTemplate}">
  211. </control:TextBoxKeyboard>
  212. </Grid>
  213. <ListBox Grid.Row="1" Grid.Column="2" ItemsSource="{Binding AiList}" ItemTemplate="{StaticResource TestingPointTemplate}"
  214. MouseDoubleClick="ListBoxAI_MouseDoubleClick">
  215. </ListBox>
  216. <!--DI测点-->
  217. <Grid Grid.Row="0" Grid.Column="4">
  218. <Grid.ColumnDefinitions>
  219. <ColumnDefinition Width="70"></ColumnDefinition>
  220. <ColumnDefinition Width="*"></ColumnDefinition>
  221. </Grid.ColumnDefinitions>
  222. <TextBlock Grid.Column="0" Style="{StaticResource LabelStyle}" Text="DI测点" />
  223. <!--规则列表检索条件-->
  224. <control:TextBoxKeyboard Grid.Column="1" MaxLength="50" Style="{StaticResource TextBox}"
  225. Text="{Binding DIFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  226. Template="{DynamicResource SearchTextBoxTemplate}">
  227. </control:TextBoxKeyboard>
  228. </Grid>
  229. <ListBox Grid.Row="1" Grid.Column="4" ItemsSource="{Binding DiList}" ItemTemplate="{StaticResource TestingPointTemplate}"
  230. MouseDoubleClick="ListBoxDI_MouseDoubleClick" >
  231. </ListBox>
  232. <!--数学函数-->
  233. <Grid Grid.Row="0" Grid.Column="6">
  234. <Grid.ColumnDefinitions>
  235. <ColumnDefinition Width="70"></ColumnDefinition>
  236. <ColumnDefinition Width="*"></ColumnDefinition>
  237. </Grid.ColumnDefinitions>
  238. <TextBlock Grid.Column="0" Style="{StaticResource LabelStyle}" Text="函数" />
  239. <!--规则列表检索条件-->
  240. <control:TextBoxKeyboard Grid.Column="1" MaxLength="50" Style="{StaticResource TextBox}"
  241. Text="{Binding MethodFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  242. Template="{DynamicResource SearchTextBoxTemplate}">
  243. </control:TextBoxKeyboard>
  244. </Grid>
  245. <ListBox Grid.Row="1" Grid.Column="6" MouseDoubleClick="ListBoxMath_MouseDoubleClick"
  246. ItemsSource="{Binding MethodList}">
  247. </ListBox>
  248. <!--运算符-->
  249. <Border Grid.Row="0" Grid.Column="8" >
  250. <TextBlock Style="{StaticResource LabelStyle}">
  251. <Run Text="运算符"></Run>
  252. </TextBlock>
  253. </Border>
  254. <ListBox Grid.Row="1" Grid.Column="8" MouseDoubleClick="ListBoxSymbol_MouseDoubleClick" >
  255. <ListBox.ItemsPanel>
  256. <ItemsPanelTemplate>
  257. <UniformGrid Columns="4" Rows="6"/>
  258. </ItemsPanelTemplate>
  259. </ListBox.ItemsPanel>
  260. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">+</ListBoxItem>
  261. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">-</ListBoxItem>
  262. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">*</ListBoxItem>
  263. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">/</ListBoxItem>
  264. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">(</ListBoxItem>
  265. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">)</ListBoxItem>
  266. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">&gt;</ListBoxItem>
  267. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">&gt;=</ListBoxItem>
  268. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">&lt;</ListBoxItem>
  269. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">&lt;=</ListBoxItem>
  270. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">==</ListBoxItem>
  271. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">!=</ListBoxItem>
  272. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">&amp;&amp;</ListBoxItem>
  273. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">||</ListBoxItem>
  274. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">!</ListBoxItem>
  275. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">%</ListBoxItem>
  276. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">true</ListBoxItem>
  277. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}" Content="false" Margin="0"/>
  278. <ListBoxItem Style="{StaticResource AlternativeColorItemStyle}">,</ListBoxItem>
  279. </ListBox>
  280. </Grid>
  281. </Border>
  282. </Grid>
  283. </Border>
  284. <Border Grid.Row="3" IsEnabled="{Binding IsFormEditable}" Style="{StaticResource FormBorderStyle}" Background="{StaticResource second-background-color-brush }" >
  285. <Grid>
  286. <Grid.RowDefinitions>
  287. <RowDefinition></RowDefinition>
  288. <RowDefinition></RowDefinition>
  289. </Grid.RowDefinitions>
  290. <Grid.ColumnDefinitions>
  291. <ColumnDefinition Width="*"></ColumnDefinition>
  292. <ColumnDefinition Width="*"></ColumnDefinition>
  293. </Grid.ColumnDefinitions>
  294. <TextBlock Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="0" Text="规则描述"/>
  295. <TextBox Text="{Binding AlertRule.Description, Mode=TwoWay}"
  296. Grid.Row="1" Grid.Column="0" Style="{StaticResource TextArea}" />
  297. <TextBlock Grid.Row="0" Grid.Column="1" Margin="10,0,0,0" Text="标签" Style="{StaticResource LabelStyle}"></TextBlock>
  298. <TextBox x:Name="txtTag" Grid.Row="1" Grid.Column="1" Margin="10,0,0,0" Text="{Binding AlertRule.Tag, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}"
  299. Style="{StaticResource TextArea}" />
  300. </Grid>
  301. </Border>
  302. <Grid Grid.Row="4" Margin="0,10,0,10" >
  303. <Grid.ColumnDefinitions>
  304. <ColumnDefinition Width="*"></ColumnDefinition>
  305. <ColumnDefinition Width="60"></ColumnDefinition>
  306. <ColumnDefinition Width="20"></ColumnDefinition>
  307. <ColumnDefinition Width="80"></ColumnDefinition>
  308. <ColumnDefinition Width="60"></ColumnDefinition>
  309. </Grid.ColumnDefinitions>
  310. <Button Grid.Column="1" Style="{StaticResource ConfirmButtonStyle}" Height="30" Width="60" Focusable="True"
  311. HorizontalAlignment="Left" VerticalAlignment="Bottom" IsEnabled="{Binding IsFormEditable}"
  312. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.SaveCommand }" IsDefault="True">
  313. <TextBlock Text="确 定" Style="{StaticResource ButtonLabelStyle}"></TextBlock>
  314. </Button>
  315. <Button Grid.Column="3" Name="CancelButton" Style="{StaticResource CancelButtonStyle}" Height="30" Width="60" Focusable="True"
  316. HorizontalAlignment="Right" VerticalAlignment="Bottom" IsDefault="True"
  317. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.CancelCommand }" IsCancel="True">
  318. <TextBlock Text="取 消" Style="{StaticResource ButtonLabelStyle}"></TextBlock>
  319. </Button>
  320. </Grid>
  321. </Grid>
  322. </UserControl>