终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

252 satır
12 KiB

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