SCItemEditor.xaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <UserControl x:Class="MECF.Framework.UI.Core.Control.SCItemEditor"
  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="450" d:DesignWidth="900">
  10. <Grid>
  11. <DataGrid AutoGenerateColumns="False" Margin="5"
  12. Background="White" ItemsSource="{Binding ScItemList, Mode=OneWay}"
  13. SelectionMode="Single" SelectionUnit="FullRow"
  14. FontFamily="Arial,SimSun" FontSize="13"
  15. BorderThickness="0.1"
  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="Name" Width="250" CanUserSort="True" IsReadOnly="True" Binding="{Binding PathName,Mode=OneWay}">
  21. </DataGridTextColumn>
  22. <DataGridTemplateColumn Header="Description" Width="200" >
  23. <DataGridTemplateColumn.CellTemplate>
  24. <DataTemplate>
  25. <TextBox Text="{Binding Description, Mode=OneWay }" TextWrapping="Wrap" FontSize="12"/>
  26. </DataTemplate>
  27. </DataGridTemplateColumn.CellTemplate>
  28. </DataGridTemplateColumn>
  29. <DataGridTextColumn Header="Type" Width="50" CanUserSort="True" IsReadOnly="True" Binding="{Binding Type,Mode=OneWay}">
  30. </DataGridTextColumn>
  31. <DataGridTextColumn Header="Min" Width="90" CanUserSort="True" IsReadOnly="True" Binding="{Binding Min,Mode=OneWay}">
  32. </DataGridTextColumn>
  33. <DataGridTextColumn Header="Max" Width="90" CanUserSort="True" IsReadOnly="True" Binding="{Binding Max,Mode=OneWay}">
  34. </DataGridTextColumn>
  35. <DataGridTextColumn Header="Value" Width="100" CanUserSort="True" IsReadOnly="True" Binding="{Binding Value,Mode=OneWay}">
  36. </DataGridTextColumn>
  37. <DataGridTemplateColumn Header="SetPoint" Width="90" CanUserSort="True" SortMemberPath="Type">
  38. <DataGridTemplateColumn.CellTemplate>
  39. <DataTemplate>
  40. <TextBox Text="{Binding SetPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="12"/>
  41. </DataTemplate>
  42. </DataGridTemplateColumn.CellTemplate>
  43. </DataGridTemplateColumn>
  44. <DataGridTemplateColumn Header="Command" Width="90" CanUserSort="False" >
  45. <DataGridTemplateColumn.CellTemplate>
  46. <DataTemplate>
  47. <Button Content="Set" FontSize="12" Command="{Binding RelativeSource={RelativeSource FindAncestor,
  48. AncestorType={x:Type DataGrid}}, Path=DataContext.SetScCommand}" CommandParameter="{Binding PathName}"/>
  49. </DataTemplate>
  50. </DataGridTemplateColumn.CellTemplate>
  51. </DataGridTemplateColumn>
  52. </DataGrid.Columns>
  53. </DataGrid>
  54. </Grid>
  55. </UserControl>