SimulatorDiItemEditor.xaml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <UserControl x:Class="MECF.Framework.UI.Core.Control.SimulatorDiItemEditor"
  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.Core.Control"
  7. xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
  8. mc:Ignorable="d"
  9. d:DesignHeight="900" d:DesignWidth="1000">
  10. <Grid>
  11. <DataGrid AutoGenerateColumns="False" Margin="0,0,0,0" Padding="0"
  12. Background="White" ItemsSource="{Binding DiItemList, Mode=OneWay}"
  13. SelectionMode="Single" SelectionUnit="CellOrRowHeader"
  14. FontFamily="Arial,SimSun" FontSize="17"
  15. BorderThickness="0.1" RowHeight="35"
  16. CanUserDeleteRows="False" CanUserAddRows="False" IsReadOnly="True" >
  17. <DataGrid.Columns>
  18. <DataGridTextColumn Header="Index" Width="50" CanUserSort="True" IsReadOnly="True" Binding="{Binding Index,Mode=OneWay}">
  19. </DataGridTextColumn>
  20. <DataGridTextColumn Header="Address" Width="80" CanUserSort="True" IsReadOnly="True" Binding="{Binding Address,Mode=OneWay}">
  21. </DataGridTextColumn>
  22. <DataGridTemplateColumn Header="Item" Width="300" >
  23. <DataGridTemplateColumn.CellTemplate>
  24. <DataTemplate>
  25. <ToggleButton VerticalAlignment="Stretch" HorizontalAlignment="Stretch" SnapsToDevicePixels="True" Padding="0" Margin="0" Content="{Binding Name, Mode=OneWay }" Height="20" IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="12"/>
  26. </DataTemplate>
  27. </DataGridTemplateColumn.CellTemplate>
  28. </DataGridTemplateColumn>
  29. <DataGridTemplateColumn Header="Value" Width="50" >
  30. <DataGridTemplateColumn.CellTemplate>
  31. <DataTemplate>
  32. <CheckBox IsChecked="{Binding HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="12"/>
  33. </DataTemplate>
  34. </DataGridTemplateColumn.CellTemplate>
  35. </DataGridTemplateColumn>
  36. <DataGridTemplateColumn Header="Description" Width="300" >
  37. <DataGridTemplateColumn.CellTemplate>
  38. <DataTemplate>
  39. <TextBox Text="{Binding Description, Mode=OneWay }" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Padding="0" Margin="0" IsReadOnly="True" IsEnabled="False" TextWrapping="Wrap" FontSize="12"/>
  40. </DataTemplate>
  41. </DataGridTemplateColumn.CellTemplate>
  42. </DataGridTemplateColumn>
  43. </DataGrid.Columns>
  44. </DataGrid>
  45. </Grid>
  46. </UserControl>