ParameterView.xaml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <UserControl x:Class="Aitex.Core.UI.View.Common.ParameterView"
  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. mc:Ignorable="d"
  7. d:DesignHeight="1024" d:DesignWidth="768">
  8. <Grid>
  9. <Grid.RowDefinitions>
  10. <RowDefinition />
  11. </Grid.RowDefinitions>
  12. <Grid.ColumnDefinitions>
  13. <ColumnDefinition Width="290" />
  14. <ColumnDefinition Width="900*" />
  15. </Grid.ColumnDefinitions>
  16. <TreeView Grid.Row="0" Grid.Column="0" Margin="4,4,0,0" Name="treeView1" Style="{StaticResource ConfigTreeView}" />
  17. <Grid Grid.Row="0" Grid.Column="1">
  18. <DataGrid x:Name="dataGrid1" Margin="5,30,5,0" ItemsSource="{Binding}"
  19. AutoGenerateColumns="False"
  20. BorderThickness="0.1"
  21. CanUserAddRows="False"
  22. CanUserDeleteRows="False"
  23. CanUserReorderColumns="False"
  24. CanUserResizeColumns="True"
  25. CanUserResizeRows="False"
  26. CanUserSortColumns="False"
  27. SelectionMode="Single"
  28. SelectionUnit="FullRow"
  29. Background="#05000000"
  30. VerticalScrollBarVisibility="Auto"
  31. HorizontalScrollBarVisibility="Disabled"
  32. FontSize="12" MinRowHeight="20"
  33. VerticalAlignment="Stretch"
  34. FontFamily="Arial,SimSun">
  35. <DataGrid.RowValidationRules>
  36. <DataErrorValidationRule ValidationStep="UpdatedValue"/>
  37. </DataGrid.RowValidationRules>
  38. <DataGrid.Columns>
  39. <DataGridTextColumn Width="275*" Binding="{Binding EntryName}" Header="名称" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  40. <DataGridTextColumn Width="200*" Binding="{Binding Description}" Header="描述" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  41. <DataGridTextColumn Width="55" Binding="{Binding Type}" Header="类型" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  42. <DataGridTextColumn Width="50" Binding="{Binding Unit}" Header="单位" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  43. <DataGridTextColumn Width="70" Binding="{Binding RangeLowLimit}" Header="最小值" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  44. <DataGridTextColumn Width="70" Binding="{Binding RangeUpLimit}" Header="最大值" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  45. <DataGridTextColumn Width="70" Binding="{Binding Default}" Header="默认值" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" />
  46. <DataGridTextColumn Width="105" Binding="{Binding Value, Mode=TwoWay}" Header="设定值" CanUserSort="False" CanUserReorder="False" IsReadOnly="False" >
  47. <DataGridTextColumn.EditingElementStyle>
  48. <Style TargetType="{x:Type TextBox}">
  49. <EventSetter Event="LostFocus" Handler="GridEditor_LostFocus" />
  50. <EventSetter Event="GotFocus" Handler="GridEditor_GotFocus" />
  51. </Style>
  52. </DataGridTextColumn.EditingElementStyle>
  53. </DataGridTextColumn>
  54. </DataGrid.Columns>
  55. </DataGrid>
  56. <Button Content="保存参数" Height="23" HorizontalAlignment="Right" Margin="0,4,108,0" Name="btnSaveParam" Click="btnSaveParam_Click" VerticalAlignment="Top" Width="75" FontSize="13" FontFamily="Arial,SimSun" />
  57. <Button Content="重新获取" Height="23" HorizontalAlignment="Right" Margin="0,4,13,0" Name="btnResetParam" Click="btnResetParam_Click" VerticalAlignment="Top" Width="75" FontSize="13" FontFamily="Arial,SimSun" />
  58. <Label Content="参数设置 " Height="40" HorizontalAlignment="Left" Name="labelTile" VerticalAlignment="Top" Width="525" FontSize="13" Margin="1,4,0,0" FontFamily="Arial,SimSun" />
  59. </Grid>
  60. </Grid>
  61. </UserControl>