终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

261 lines
12 KiB

  1. <Window x:Class="FryPot_DosingSystem.View.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
  7. xmlns:local="clr-namespace:FryPot_DosingSystem.View"
  8. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. Title="MainWindow"
  10. Width="1300"
  11. Height="800"
  12. AllowsTransparency="True"
  13. Background="{x:Null}"
  14. Topmost="False"
  15. WindowStartupLocation="CenterScreen"
  16. WindowStyle="None"
  17. mc:Ignorable="d">
  18. <Window.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  22. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  23. <ResourceDictionary>
  24. <!--#region ListBox样式-->
  25. <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
  26. <Setter Property="OverridesDefaultStyle" Value="True" />
  27. <Setter Property="SnapsToDevicePixels" Value="True" />
  28. <Setter Property="BorderBrush" Value="{x:Null}" />
  29. <Setter Property="Foreground" Value="White" />
  30. <Setter Property="FontSize" Value="20" />
  31. <Setter Property="HorizontalContentAlignment" Value="Center" />
  32. <Setter Property="VerticalContentAlignment" Value="Center" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  36. <Border x:Name="border" CornerRadius="8">
  37. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  38. </Border>
  39. </ControlTemplate>
  40. </Setter.Value>
  41. </Setter>
  42. </Style>
  43. <!--#endregion-->
  44. </ResourceDictionary>
  45. </ResourceDictionary.MergedDictionaries>
  46. </ResourceDictionary>
  47. </Window.Resources>
  48. <Window.DataContext>
  49. <vm:MainViewModel></vm:MainViewModel>
  50. </Window.DataContext>
  51. <Border x:Name="br" Style="{DynamicResource border主窗体背景}">
  52. <Grid x:Name="grid_main">
  53. <Grid.RowDefinitions>
  54. <RowDefinition Height="60" />
  55. <RowDefinition />
  56. </Grid.RowDefinitions>
  57. <!-- 标题 -->
  58. <Grid Grid.Row="0">
  59. <Grid.ColumnDefinitions>
  60. <ColumnDefinition Width="300" />
  61. <ColumnDefinition />
  62. </Grid.ColumnDefinitions>
  63. <Border
  64. Grid.ColumnSpan="2"
  65. Height="52"
  66. VerticalAlignment="Top"
  67. Style="{DynamicResource bordertop矩形}" />
  68. <Border Style="{DynamicResource bordertopL}" />
  69. <Image
  70. Margin="20,0,0,0"
  71. VerticalAlignment="Center"
  72. Style="{DynamicResource imagetop_Title}" />
  73. <Grid Grid.Column="1">
  74. <ListBox
  75. x:Name="lstEnt"
  76. Background="{x:Null}"
  77. BorderBrush="{x:Null}"
  78. ScrollViewer.CanContentScroll="False"
  79. ScrollViewer.HorizontalScrollBarVisibility="Hidden"
  80. ScrollViewer.VerticalScrollBarVisibility="Disabled"
  81. BorderThickness="0"
  82. ItemContainerStyle="{StaticResource ResourceKey=ListBoxItemStyle1}"
  83. ItemsSource="{Binding DisplayMenus}" Margin="0,0,293,0">
  84. <ListBox.ItemsPanel>
  85. <ItemsPanelTemplate>
  86. <StackPanel Orientation="Horizontal" />
  87. </ItemsPanelTemplate>
  88. </ListBox.ItemsPanel>
  89. <ListBox.ItemTemplate>
  90. <DataTemplate>
  91. <RadioButton
  92. Command="{Binding DataContext.TogglePag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  93. CommandParameter="{Binding CommandParameter}"
  94. Content="{Binding MenuName}"
  95. GroupName="all"
  96. Style="{StaticResource MenuRadioButtonStyle}" />
  97. </DataTemplate>
  98. </ListBox.ItemTemplate>
  99. </ListBox>
  100. </Grid>
  101. <StackPanel
  102. Grid.Column="4"
  103. Height="50"
  104. HorizontalAlignment="Right"
  105. VerticalAlignment="Top"
  106. Orientation="Horizontal">
  107. <Border Style="{DynamicResource border竖线}" />
  108. <Grid>
  109. <ToggleButton
  110. Name="tb"
  111. Margin="5"
  112. HorizontalAlignment="Center"
  113. VerticalAlignment="Center"
  114. Cursor="Hand"
  115. IsChecked="{Binding UserManagement}"
  116. Style="{DynamicResource StatusBtnStyle网络连接状态}"
  117. ToolTip="用户管理" />
  118. <!-- 当 StaysOpen 设置为 True 时 popup失去焦点的时候不会自动关闭 -->
  119. <Popup
  120. AllowsTransparency="True"
  121. Focusable="False"
  122. IsOpen="{Binding IsChecked, ElementName=tb}"
  123. Placement="Bottom"
  124. PlacementTarget="{Binding ElementName=tb}"
  125. StaysOpen="False">
  126. <Border Background="#081424" ClipToBounds="True">
  127. <Grid Width="100" Margin="0">
  128. <StackPanel Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}">
  129. <Button
  130. Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}"
  131. Margin="0,5,0,1"
  132. HorizontalAlignment="Center"
  133. VerticalAlignment="Center"
  134. Command="{Binding PasswordChange}"
  135. Content="密码修改"
  136. Cursor="Hand" />
  137. <Button
  138. Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}"
  139. Margin="0,5,0,1"
  140. HorizontalAlignment="Center"
  141. VerticalAlignment="Center"
  142. Command="{Binding Login}"
  143. Content="登录账号"
  144. Cursor="Hand" />
  145. <Button
  146. Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}"
  147. Margin="0,5,0,1"
  148. HorizontalAlignment="Center"
  149. VerticalAlignment="Center"
  150. Command="{Binding ExitLogin}"
  151. Content="退出登录"
  152. Cursor="Hand" />
  153. </StackPanel>
  154. </Grid>
  155. </Border>
  156. </Popup>
  157. </Grid>
  158. <Border Style="{DynamicResource border竖线}" />
  159. <ToggleButton
  160. HorizontalAlignment="Center"
  161. VerticalAlignment="Center"
  162. Cursor="Hand"
  163. DataContext="{Binding IsAlarm}"
  164. Style="{DynamicResource StatusBtnStyle告警}"
  165. ToolTip="告警消息" />
  166. <Border Style="{DynamicResource border竖线}" />
  167. <control:DateTimeUI Margin="10,0,10,0" VerticalAlignment="Center" />
  168. <Border Style="{DynamicResource border竖线}" />
  169. <Button
  170. x:Name="ButClose"
  171. Grid.Column="4"
  172. Margin="10,0,20,0"
  173. VerticalAlignment="Center"
  174. Content="退出"
  175. Cursor="Hand"
  176. Style="{DynamicResource CommonBtn_返回}"
  177. ToolTip="退出程序"
  178. />
  179. </StackPanel>
  180. </Grid>
  181. <!-- 底部窗体 -->
  182. <Grid Grid.Row="1" Margin="10">
  183. <Grid.RowDefinitions>
  184. <RowDefinition Height="45" />
  185. <RowDefinition />
  186. </Grid.RowDefinitions>
  187. <!-- 顶部装饰 -->
  188. <Border
  189. Grid.Row="0"
  190. Grid.RowSpan="2"
  191. Style="{DynamicResource border右下}" />
  192. <Border
  193. Grid.Row="0"
  194. Grid.RowSpan="2"
  195. Style="{DynamicResource border左下}" />
  196. <Border
  197. Grid.Row="0"
  198. Grid.RowSpan="2"
  199. Style="{DynamicResource border右上}" />
  200. <Border
  201. Grid.Row="0"
  202. Grid.RowSpan="2"
  203. Style="{DynamicResource border左上}" />
  204. <Grid Margin="10">
  205. <Border Width="600" Style="{DynamicResource borderFromTitle}" />
  206. <StackPanel Orientation="Horizontal">
  207. <CheckBox
  208. Margin="5,0,5,0"
  209. Content="开机启动"
  210. IsChecked="{Binding AutoStart}" />
  211. <CheckBox
  212. Margin="5,0,5,0"
  213. Content="设备初始化"
  214. IsChecked="{Binding Status}"
  215. />
  216. </StackPanel>
  217. <TextBlock
  218. x:Name="Title"
  219. HorizontalAlignment="Center"
  220. VerticalAlignment="Top"
  221. FontSize="16"
  222. Foreground="#feffff"
  223. Text="{Binding WindowTitleName}" />
  224. </Grid>
  225. <!--#region 底部窗体栏-->
  226. <ContentControl
  227. x:Name="contentRegion"
  228. Grid.Row="1"
  229. Content="{Binding MyWindow}"
  230. />
  231. <!--#endregion-->
  232. </Grid>
  233. </Grid>
  234. </Border>
  235. </Window>