IO2View.xaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <UserControl x:Class="VirgoUI.Client.Models.Common.IO.IO2View"
  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:cal="http://www.caliburn.org"
  8. xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
  9. mc:Ignorable="d" >
  10. <Grid HorizontalAlignment="Left">
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="450"></ColumnDefinition>
  13. <ColumnDefinition Width="450"></ColumnDefinition>
  14. <ColumnDefinition Width="450"></ColumnDefinition>
  15. <ColumnDefinition Width="450"></ColumnDefinition>
  16. </Grid.ColumnDefinitions>
  17. <TabControl>
  18. <TabItem Header="AI">
  19. <ListView ItemsSource="{Binding Path=AIs}"
  20. AlternationCount="2"
  21. Name="AIListView"
  22. VerticalAlignment="Top">
  23. <ListView.View>
  24. <GridView>
  25. <GridViewColumn Width="50"
  26. Header="Index"
  27. DisplayMemberBinding="{Binding Path=Index}" />
  28. <GridViewColumn Width="200"
  29. Header="Name"
  30. DisplayMemberBinding="{Binding Path=Name}" />
  31. <GridViewColumn Width="100"
  32. Header="Address"
  33. DisplayMemberBinding="{Binding Path=Address}" />
  34. <GridViewColumn Width="50"
  35. Header="Value"
  36. DisplayMemberBinding="{Binding Path=Value}" />
  37. </GridView>
  38. </ListView.View>
  39. </ListView>
  40. </TabItem>
  41. </TabControl>
  42. <TabControl Grid.Column="1">
  43. <TabItem Header="AO">
  44. <ListView ItemsSource="{Binding Path=AOs}"
  45. Grid.Column="1"
  46. AlternationCount="2"
  47. VerticalAlignment="Top"
  48. Name="AOListView">
  49. <ListView.View>
  50. <GridView>
  51. <GridViewColumn Width="50"
  52. Header="Index"
  53. DisplayMemberBinding="{Binding Path=Index}" />
  54. <GridViewColumn Width="200"
  55. Header="Name"
  56. DisplayMemberBinding="{Binding Path=Name}" />
  57. <GridViewColumn Width="100"
  58. Header="Address"
  59. DisplayMemberBinding="{Binding Path=Address}" />
  60. <GridViewColumn Width="50"
  61. Header="Value"
  62. DisplayMemberBinding="{Binding Path=Value}" />
  63. <GridViewColumn Width="60" >
  64. <GridViewColumn.CellTemplate>
  65. <DataTemplate >
  66. <TextBox Text="{Binding Path=NewValue}" Width="45"></TextBox>
  67. </DataTemplate>
  68. </GridViewColumn.CellTemplate>
  69. </GridViewColumn>
  70. <GridViewColumn Width="50" >
  71. <GridViewColumn.CellTemplate>
  72. <DataTemplate >
  73. <Button Content="Set" Height="20" Width="35">
  74. <i:Interaction.Triggers>
  75. <i:EventTrigger EventName="Click">
  76. <cal:ActionMessage MethodName="SetAO">
  77. <cal:Parameter Value="{Binding }" />
  78. </cal:ActionMessage>
  79. </i:EventTrigger>
  80. </i:Interaction.Triggers>
  81. </Button>
  82. </DataTemplate>
  83. </GridViewColumn.CellTemplate>
  84. </GridViewColumn>
  85. </GridView>
  86. </ListView.View>
  87. </ListView>
  88. </TabItem>
  89. </TabControl>
  90. <TabControl Grid.Column="2" Margin="5,0,0,0">
  91. <TabItem Header="DI">
  92. <ListView ItemsSource="{Binding Path=DIs}"
  93. Grid.Column="2"
  94. AlternationCount="2"
  95. VerticalAlignment="Top"
  96. Name="DIListView">
  97. <ListView.View>
  98. <GridView>
  99. <GridViewColumn Width="50"
  100. Header="Index"
  101. DisplayMemberBinding="{Binding Path=Index}" />
  102. <GridViewColumn Width="200"
  103. Header="Name"
  104. DisplayMemberBinding="{Binding Path=Name}" />
  105. <GridViewColumn Width="100"
  106. Header="Address"
  107. DisplayMemberBinding="{Binding Path=Address}" />
  108. <GridViewColumn Width="50" Header="Status">
  109. <GridViewColumn.CellTemplate>
  110. <DataTemplate>
  111. <Grid Width="35">
  112. <ctrl:SwitchButton HorizontalAlignment="Center"
  113. ON="{Binding Value}"
  114. Style="{StaticResource Lamp-Button}">
  115. </ctrl:SwitchButton>
  116. </Grid>
  117. </DataTemplate>
  118. </GridViewColumn.CellTemplate>
  119. </GridViewColumn>
  120. </GridView>
  121. </ListView.View>
  122. </ListView>
  123. </TabItem>
  124. </TabControl>
  125. <TabControl Grid.Column="3" Margin="5,0,0,0">
  126. <TabItem Header="DO">
  127. <ListView ItemsSource="{Binding Path=DOs}"
  128. Grid.Column="3"
  129. AlternationCount="2"
  130. VerticalAlignment="Top"
  131. Name="DOListView">
  132. <ListView.View>
  133. <GridView>
  134. <GridViewColumn Width="50"
  135. Header="Index"
  136. DisplayMemberBinding="{Binding Path=Index}" />
  137. <GridViewColumn Width="200"
  138. Header="Name"
  139. DisplayMemberBinding="{Binding Path=Name}" />
  140. <GridViewColumn Width="100"
  141. Header="Address"
  142. DisplayMemberBinding="{Binding Path=Address}" />
  143. <GridViewColumn Width="50" Header="Status">
  144. <GridViewColumn.CellTemplate>
  145. <DataTemplate >
  146. <Grid Width="35">
  147. <ctrl:SwitchButton HorizontalAlignment="Center"
  148. ON="{Binding Value}"
  149. Style="{StaticResource Lamp-Button}">
  150. </ctrl:SwitchButton>
  151. </Grid>
  152. </DataTemplate>
  153. </GridViewColumn.CellTemplate>
  154. </GridViewColumn>
  155. <GridViewColumn Width="60" Header="Operation">
  156. <GridViewColumn.CellTemplate>
  157. <DataTemplate >
  158. <Grid Width="45">
  159. <ctrl:SwitchButton ON="{Binding Value}" Style="{StaticResource OperationButton}" HorizontalAlignment="Center">
  160. <i:Interaction.Triggers>
  161. <i:EventTrigger EventName="Click">
  162. <cal:ActionMessage MethodName="SetDO">
  163. <cal:Parameter Value="{Binding }" />
  164. </cal:ActionMessage>
  165. </i:EventTrigger>
  166. </i:Interaction.Triggers>
  167. </ctrl:SwitchButton>
  168. </Grid>
  169. </DataTemplate>
  170. </GridViewColumn.CellTemplate>
  171. </GridViewColumn>
  172. </GridView>
  173. </ListView.View>
  174. </ListView>
  175. </TabItem>
  176. </TabControl>
  177. </Grid>
  178. </UserControl>