DiItemEditor.xaml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <UserControl x:Class="MECF.Framework.UI.Core.Control.DiItemEditor"
  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. xmlns:converters="clr-namespace:MECF.Framework.UI.Core.Converters"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="700">
  11. <Control.Resources>
  12. <converters:BoolSensorConverter x:Key="BoolSensorConverter"></converters:BoolSensorConverter>
  13. </Control.Resources>
  14. <Grid>
  15. <DataGrid AutoGenerateColumns="False" Margin="5"
  16. Background="White" ItemsSource="{Binding DiItemList, Mode=OneWay}"
  17. SelectionMode="Single" SelectionUnit="FullRow"
  18. FontFamily="Arial,SimSun" FontSize="13"
  19. BorderThickness="0.1"
  20. CanUserDeleteRows="False" CanUserAddRows="False" IsReadOnly="True" >
  21. <DataGrid.Columns>
  22. <DataGridTextColumn Header="Index" Width="50" CanUserSort="True" IsReadOnly="True" Binding="{Binding Index,Mode=OneWay}">
  23. </DataGridTextColumn>
  24. <DataGridTextColumn Header="Name" Width="200" CanUserSort="True" IsReadOnly="True" Binding="{Binding Name,Mode=OneWay}">
  25. </DataGridTextColumn>
  26. <DataGridTextColumn Header="Address" Width="80" CanUserSort="True" IsReadOnly="True" Binding="{Binding Address,Mode=OneWay}">
  27. </DataGridTextColumn>
  28. <DataGridTemplateColumn Header="Feedback" Width="80" >
  29. <DataGridTemplateColumn.CellTemplate>
  30. <DataTemplate>
  31. <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="LightGray" StrokeThickness="1" Width="15" Height="15"
  32. Fill="{Binding BoolValue,Converter={StaticResource BoolSensorConverter}}" x:Name="sensor" Style="{x:Null}"/>
  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 }" IsReadOnly="True" IsEnabled="False" TextWrapping="Wrap" FontSize="12"/>
  40. </DataTemplate>
  41. </DataGridTemplateColumn.CellTemplate>
  42. </DataGridTemplateColumn>
  43. </DataGrid.Columns>
  44. </DataGrid>
  45. </Grid>
  46. </UserControl>