SignalTowerConfigView.xaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig.SignalTowerConfigView"
  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:i="http://schemas.microsoft.com/expression/2010/interactivity"
  7. xmlns:micro="clr-namespace:Caliburn.Micro"
  8. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  9. xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
  10. xmlns:signalTowerConfig="clr-namespace:MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig"
  11. mc:Ignorable="d"
  12. d:DesignHeight="1024" d:DesignWidth="1900">
  13. <UserControl.Resources>
  14. <converter:Bool2Not x:Key="Bool2Not"/>
  15. <converter:BoolCollapsedConverter x:Key="BoolVisibility"/>
  16. </UserControl.Resources>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="30"/>
  20. <RowDefinition Height="*"/>
  21. </Grid.RowDefinitions>
  22. <Grid Grid.Row="0">
  23. <Grid.ColumnDefinitions>
  24. <ColumnDefinition Width="150"/>
  25. <ColumnDefinition Width="100"/>
  26. <ColumnDefinition Width="100"/>
  27. <ColumnDefinition Width="*"/>
  28. </Grid.ColumnDefinitions>
  29. <Button Content="Save" Grid.Column="1" Width="90" Height="30" Margin="0" Padding="0" >
  30. <i:Interaction.Triggers>
  31. <i:EventTrigger EventName="Click">
  32. <micro:ActionMessage MethodName="SaveSelection">
  33. </micro:ActionMessage>
  34. </i:EventTrigger>
  35. </i:Interaction.Triggers>
  36. </Button>
  37. <Button Content="Cancel" Grid.Column="2" Width="90" Height="30" Margin="0" Padding="0" >
  38. <i:Interaction.Triggers>
  39. <i:EventTrigger EventName="Click">
  40. <micro:ActionMessage MethodName="CancelSelection">
  41. </micro:ActionMessage>
  42. </i:EventTrigger>
  43. </i:Interaction.Triggers>
  44. </Button>
  45. </Grid>
  46. <Grid Grid.Row="1">
  47. <DataGrid HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
  48. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
  49. ItemsSource="{Binding SignalTowerData}" Margin="0,5,0,0" >
  50. <DataGrid.Columns>
  51. <DataGridTemplateColumn Header="Condition Name" Width="300">
  52. <DataGridTemplateColumn.CellTemplate>
  53. <DataTemplate>
  54. <TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  55. </TextBlock>
  56. </DataTemplate>
  57. </DataGridTemplateColumn.CellTemplate>
  58. </DataGridTemplateColumn>
  59. <DataGridTemplateColumn Header="Red" Width="140">
  60. <DataGridTemplateColumn.CellTemplate>
  61. <DataTemplate>
  62. <Border HorizontalAlignment="Stretch" Background="OrangeRed">
  63. <StackPanel Orientation="Horizontal">
  64. <CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsRed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
  65. <CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsRedBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
  66. </StackPanel>
  67. </Border>
  68. </DataTemplate>
  69. </DataGridTemplateColumn.CellTemplate>
  70. </DataGridTemplateColumn>
  71. <DataGridTemplateColumn Header="Yellow" Width="140">
  72. <DataGridTemplateColumn.CellTemplate>
  73. <DataTemplate>
  74. <Border HorizontalAlignment="Stretch" Background="LightGoldenrodYellow">
  75. <StackPanel Orientation="Horizontal">
  76. <CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsYellow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
  77. <CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsYellowBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
  78. </StackPanel> </Border>
  79. </DataTemplate>
  80. </DataGridTemplateColumn.CellTemplate>
  81. </DataGridTemplateColumn>
  82. <DataGridTemplateColumn Header="Green" Width="140">
  83. <DataGridTemplateColumn.CellTemplate>
  84. <DataTemplate>
  85. <Border HorizontalAlignment="Stretch" Background="LightGreen">
  86. <StackPanel Orientation="Horizontal">
  87. <CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsGreen, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
  88. <CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsGreenBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
  89. </StackPanel> </Border>
  90. </DataTemplate>
  91. </DataGridTemplateColumn.CellTemplate>
  92. </DataGridTemplateColumn>
  93. <DataGridTemplateColumn Header="Blue" Width="140">
  94. <DataGridTemplateColumn.CellTemplate>
  95. <DataTemplate>
  96. <Border HorizontalAlignment="Stretch" Background="LightBlue">
  97. <StackPanel Orientation="Horizontal">
  98. <CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsBlue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
  99. <CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsBlueBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
  100. </StackPanel> </Border>
  101. </DataTemplate>
  102. </DataGridTemplateColumn.CellTemplate>
  103. </DataGridTemplateColumn>
  104. <DataGridTemplateColumn Header="Buzzer" Width="140">
  105. <DataGridTemplateColumn.CellTemplate>
  106. <DataTemplate>
  107. <Border HorizontalAlignment="Stretch" Background="White">
  108. <StackPanel Orientation="Horizontal">
  109. <CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsBuzzer, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
  110. <CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsBuzzerBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
  111. </StackPanel> </Border>
  112. </DataTemplate>
  113. </DataGridTemplateColumn.CellTemplate>
  114. </DataGridTemplateColumn>
  115. </DataGrid.Columns>
  116. </DataGrid>
  117. </Grid>
  118. </Grid>
  119. </UserControl>