ShakerMiniStatusControl.axaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl
  2. x:Class="ShakerApp.Views.ShakerMiniStatusControl"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:suki="https://github.com/kikipoulet/SukiUI"
  8. xmlns:vm="using:ShakerApp.ViewModels"
  9. d:DesignHeight="450"
  10. d:DesignWidth="150"
  11. x:DataType="vm:ShakerStatusViewModel"
  12. DataContext="{Binding Source={x:Static vm:ShakerStatusViewModel.Instance}}"
  13. mc:Ignorable="d">
  14. <StackPanel>
  15. <suki:GroupBox>
  16. <suki:GroupBox.Header>
  17. <TextBlock
  18. Margin="4,0,0,0"
  19. FontSize="24"
  20. FontWeight="Bold"
  21. Text="{DynamicResource TestControl}" />
  22. </suki:GroupBox.Header>
  23. <StackPanel
  24. HorizontalAlignment="Center"
  25. VerticalAlignment="Center"
  26. Orientation="Horizontal">
  27. <StackPanel>
  28. <TextBlock
  29. HorizontalAlignment="Center"
  30. VerticalAlignment="Center"
  31. Text="{DynamicResource Start}" />
  32. <Button
  33. Width="60"
  34. Height="60"
  35. Classes="Basic"
  36. Command="{Binding StartCommand}"
  37. IsEnabled="{Binding SignalStartEnabled}">
  38. <PathIcon
  39. Width="50"
  40. Height="50"
  41. Padding="0"
  42. Data="{StaticResource StartGeometry}">
  43. <PathIcon.Styles>
  44. <Style Selector="PathIcon">
  45. <Setter Property="Foreground" Value="Green" />
  46. </Style>
  47. <Style Selector="PathIcon:disabled">
  48. <Setter Property="Foreground" Value="Gray" />
  49. </Style>
  50. </PathIcon.Styles>
  51. </PathIcon>
  52. </Button>
  53. </StackPanel>
  54. <StackPanel Margin="10,0,0,0">
  55. <TextBlock
  56. HorizontalAlignment="Center"
  57. VerticalAlignment="Center"
  58. Text="{DynamicResource Stop}" />
  59. <Button
  60. Width="60"
  61. Height="60"
  62. Classes="Basic"
  63. Command="{Binding StopCommand}"
  64. IsEnabled="{Binding SignalStopEnabled}">
  65. <PathIcon
  66. Width="45"
  67. Height="45"
  68. Padding="0"
  69. Data="{StaticResource StopGeometry}">
  70. <PathIcon.Styles>
  71. <Style Selector="PathIcon">
  72. <Setter Property="Foreground" Value="Red" />
  73. </Style>
  74. <Style Selector="PathIcon:disabled">
  75. <Setter Property="Foreground" Value="Gray" />
  76. </Style>
  77. </PathIcon.Styles>
  78. </PathIcon>
  79. </Button>
  80. </StackPanel>
  81. </StackPanel>
  82. </suki:GroupBox>
  83. <Expander ExpandDirection="Down">
  84. <Expander.Header>
  85. <TextBlock
  86. FontSize="24"
  87. FontWeight="Bold"
  88. Text="{DynamicResource SignalValue}" />
  89. </Expander.Header>
  90. <StackPanel>
  91. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  92. <TextBlock
  93. Margin="4,0,0,0"
  94. VerticalAlignment="Center"
  95. FontSize="14"
  96. FontWeight="Bold">
  97. <Run Text="{DynamicResource GivenDisplacementSignal}" />
  98. <Run Text=":" />
  99. </TextBlock>
  100. <TextBlock
  101. Margin="4,0,0,0"
  102. VerticalAlignment="Center"
  103. FontSize="14"
  104. Text="{Binding GivenDisplacement, StringFormat='{}{0}mm'}" />
  105. </StackPanel>
  106. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  107. <TextBlock
  108. Margin="4,0,0,0"
  109. VerticalAlignment="Center"
  110. FontSize="14"
  111. FontWeight="Bold">
  112. <Run Text="{DynamicResource MeasuredDisplacementSignal}" />
  113. <Run Text=":" />
  114. </TextBlock>
  115. <TextBlock
  116. Margin="4,0,0,0"
  117. VerticalAlignment="Center"
  118. FontSize="14"
  119. Text="{Binding MeasuredDisplacement, StringFormat='{}{0}mm'}" />
  120. </StackPanel>
  121. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  122. <TextBlock
  123. Margin="4,0,0,0"
  124. VerticalAlignment="Center"
  125. FontSize="14"
  126. FontWeight="Bold">
  127. <Run Text="{DynamicResource AccelerationSignal}" />
  128. <Run Text=":" />
  129. </TextBlock>
  130. <TextBlock
  131. Margin="4,0,0,0"
  132. VerticalAlignment="Center"
  133. FontSize="14"
  134. Text="{Binding Acceleration, StringFormat='{}{0}g'}" />
  135. </StackPanel>
  136. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  137. <TextBlock
  138. Margin="4,0,0,0"
  139. VerticalAlignment="Center"
  140. FontSize="14"
  141. FontWeight="Bold">
  142. <Run Text="{DynamicResource ValveDriveSignal}" />
  143. <Run Text=":" />
  144. </TextBlock>
  145. <TextBlock
  146. Margin="4,0,0,0"
  147. VerticalAlignment="Center"
  148. FontSize="14"
  149. Text="{Binding ValveDrive, StringFormat='{}{0}V'}" />
  150. </StackPanel>
  151. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  152. <TextBlock
  153. Margin="4,0,0,0"
  154. VerticalAlignment="Center"
  155. FontSize="14"
  156. FontWeight="Bold">
  157. <Run Text="{DynamicResource OutInputSignal}" />
  158. <Run Text=":" />
  159. </TextBlock>
  160. <TextBlock
  161. Margin="4,0,0,0"
  162. VerticalAlignment="Center"
  163. FontSize="14"
  164. Text="{Binding OutSignal, StringFormat='{}{0}V'}" />
  165. </StackPanel>
  166. </StackPanel>
  167. </Expander>
  168. </StackPanel>
  169. </UserControl>