终端一体化运控平台
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.
 
 
 

283 lines
12 KiB

  1. <Window
  2. x:Class="BPASmart.ConfigurationSoftware.MainWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmart.ConfigurationSoftware"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Title="MainWindow"
  9. Width="800"
  10. Height="450"
  11. Topmost="False"
  12. WindowStartupLocation="CenterScreen"
  13. WindowState="Maximized"
  14. mc:Ignorable="d">
  15. <Window.DataContext>
  16. <local:MainWindowViewModel />
  17. </Window.DataContext>
  18. <Window.Resources>
  19. <!--#region 下拉列表单选按钮样式-->
  20. <Style x:Key="RadioMiniButtonStyle" TargetType="{x:Type RadioButton}">
  21. <Setter Property="Margin" Value="20,1,1,1" />
  22. <!--<Setter Property="Width" Value="160" />-->
  23. <!--<Setter Property="Height" Value="30" />-->
  24. <Setter Property="FontSize" Value="14" />
  25. <Setter Property="FontFamily" Value="粗体" />
  26. <Setter Property="VerticalContentAlignment" Value="Center" />
  27. <Setter Property="HorizontalContentAlignment" Value="left" />
  28. <Setter Property="BorderBrush" Value="Transparent" />
  29. <Setter Property="BorderThickness" Value="0" />
  30. <Setter Property="Background" Value="#ddd" />
  31. <Setter Property="HorizontalAlignment" Value="left" />
  32. <Setter Property="Template">
  33. <Setter.Value>
  34. <ControlTemplate TargetType="{x:Type RadioButton}">
  35. <Grid
  36. x:Name="templateRoot"
  37. Background="Transparent"
  38. SnapsToDevicePixels="True">
  39. <Border x:Name="border2" />
  40. <ContentPresenter
  41. x:Name="contentPresenter"
  42. Margin="{TemplateBinding Padding}"
  43. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  44. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  45. Content="{TemplateBinding Content}"
  46. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  47. ContentTemplate="{TemplateBinding ContentTemplate}"
  48. Focusable="False"
  49. RecognizesAccessKey="True"
  50. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  51. </Grid>
  52. <ControlTemplate.Triggers>
  53. <Trigger Property="HasContent" Value="True">
  54. <Setter Property="FocusVisualStyle">
  55. <Setter.Value>
  56. <Style>
  57. <Setter Property="Control.Template">
  58. <Setter.Value>
  59. <ControlTemplate>
  60. <Rectangle
  61. Margin="14,0,0,0"
  62. SnapsToDevicePixels="True"
  63. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  64. StrokeDashArray="1 2"
  65. StrokeThickness="1" />
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. </Setter.Value>
  71. </Setter>
  72. <Setter Property="Padding" Value="4,-1,0,0" />
  73. </Trigger>
  74. <Trigger Property="IsChecked" Value="{x:Null}" />
  75. <Trigger Property="IsChecked" Value="true">
  76. <!--<Setter Property="Foreground" Value="White" />-->
  77. <Setter TargetName="border2" Property="Background" Value="red" />
  78. </Trigger>
  79. <Trigger Property="IsChecked" Value="false">
  80. <Setter TargetName="border2" Property="Background" Value="Transparent" />
  81. <!--<Setter Property="Foreground" Value="#4B8EC4" />-->
  82. </Trigger>
  83. <MultiTrigger>
  84. <MultiTrigger.Conditions>
  85. <Condition Property="IsChecked" Value="false" />
  86. <Condition Property="IsMouseOver" Value="True" />
  87. </MultiTrigger.Conditions>
  88. <MultiTrigger.Setters>
  89. <Setter TargetName="border2" Property="Background" Value="#55007acc" />
  90. </MultiTrigger.Setters>
  91. </MultiTrigger>
  92. </ControlTemplate.Triggers>
  93. </ControlTemplate>
  94. </Setter.Value>
  95. </Setter>
  96. </Style>
  97. <!--#endregion-->
  98. </Window.Resources>
  99. <Grid>
  100. <Grid.RowDefinitions>
  101. <RowDefinition Height="30" />
  102. <RowDefinition />
  103. </Grid.RowDefinitions>
  104. <StackPanel Orientation="Horizontal">
  105. <Button
  106. Width="60"
  107. Margin="5"
  108. Command="{Binding NewProjectCommand}"
  109. Content="新建" />
  110. <Button
  111. Width="60"
  112. Margin="5"
  113. Command="{Binding SaveProjectCommand}"
  114. Content="保存" />
  115. <Button
  116. Width="60"
  117. Margin="5"
  118. Command="{Binding}"
  119. Content="打开" />
  120. <Button
  121. Width="60"
  122. Margin="5"
  123. Content="运行" />
  124. <Button
  125. Width="60"
  126. Margin="5"
  127. Command="{Binding GengrateCommand}"
  128. Content="生成" />
  129. <Button
  130. Width="60"
  131. Margin="5"
  132. Command="{Binding OpenVarManagerCommand}"
  133. Content="变量管理" />
  134. </StackPanel>
  135. <Grid Grid.Row="1">
  136. <Grid.ColumnDefinitions>
  137. <ColumnDefinition Width="150" />
  138. <ColumnDefinition Width="5" />
  139. <ColumnDefinition />
  140. </Grid.ColumnDefinitions>
  141. <Border BorderBrush="Blue" BorderThickness="2">
  142. <Grid>
  143. <Grid.RowDefinitions>
  144. <RowDefinition Height="20" />
  145. <RowDefinition />
  146. </Grid.RowDefinitions>
  147. <TextBlock
  148. Margin="5,0,0,0"
  149. HorizontalAlignment="Left"
  150. VerticalAlignment="Center"
  151. Text="{Binding Head}">
  152. <TextBlock.ContextMenu>
  153. <ContextMenu>
  154. <MenuItem Command="{Binding NewPageCommand}" Header="新建页面" />
  155. </ContextMenu>
  156. </TextBlock.ContextMenu>
  157. </TextBlock>
  158. <ScrollViewer
  159. Grid.Row="1"
  160. HorizontalScrollBarVisibility="Hidden"
  161. VerticalScrollBarVisibility="Hidden">
  162. <ItemsControl ItemsSource="{Binding Pages}">
  163. <ItemsControl.ItemTemplate>
  164. <DataTemplate>
  165. <Grid>
  166. <RadioButton
  167. Command="{Binding DataContext.SelectedPageCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  168. CommandParameter="{Binding}"
  169. Content="{Binding}"
  170. GroupName="All"
  171. Style="{StaticResource RadioMiniButtonStyle}">
  172. <RadioButton.ContextMenu>
  173. <ContextMenu>
  174. <MenuItem
  175. Command="{Binding DataContext.RemovePageCommand, RelativeSource={RelativeSource AncestorType=Grid, AncestorLevel=4, Mode=FindAncestor}}"
  176. CommandParameter="{Binding}"
  177. Header="删除页面" />
  178. <MenuItem
  179. Command="{Binding DataContext.SetStartPageCommand, RelativeSource={RelativeSource AncestorType=Grid, AncestorLevel=4, Mode=FindAncestor}}"
  180. CommandParameter="{Binding}"
  181. Header="设为启动界面" />
  182. <MenuItem
  183. Command="{Binding DataContext.ReNameCommand, RelativeSource={RelativeSource AncestorType=Grid, AncestorLevel=4, Mode=FindAncestor}}"
  184. CommandParameter="{Binding}"
  185. Header="重命名" />
  186. </ContextMenu>
  187. </RadioButton.ContextMenu>
  188. </RadioButton>
  189. </Grid>
  190. </DataTemplate>
  191. </ItemsControl.ItemTemplate>
  192. </ItemsControl>
  193. </ScrollViewer>
  194. </Grid>
  195. </Border>
  196. <GridSplitter
  197. Grid.Row="2"
  198. Width="2"
  199. VerticalAlignment="Stretch"
  200. Background="Blue" />
  201. <Grid
  202. Name="gr"
  203. Grid.Row="1"
  204. Grid.Column="2"
  205. Background="Transparent">
  206. <Grid.RowDefinitions>
  207. <RowDefinition Height="30" />
  208. <RowDefinition />
  209. <RowDefinition Height="2" />
  210. <RowDefinition Height="100" />
  211. </Grid.RowDefinitions>
  212. <ContentControl
  213. Grid.Row="1"
  214. Width="auto"
  215. Height="auto"
  216. Margin="0,0,0,5"
  217. Content="{Binding MainContent}" />
  218. <Border
  219. Grid.Row="2"
  220. Grid.RowSpan="2"
  221. Margin="-7,0,0,0"
  222. BorderBrush="Blue"
  223. BorderThickness="2">
  224. <Grid Margin="5,5,0,0">
  225. <ScrollViewer>
  226. <ItemsControl ItemsSource="{Binding Message}">
  227. <ItemsControl.ItemTemplate>
  228. <DataTemplate>
  229. <Grid>
  230. <TextBlock
  231. FontSize="16"
  232. Foreground="Blue"
  233. Text="{Binding}" />
  234. </Grid>
  235. </DataTemplate>
  236. </ItemsControl.ItemTemplate>
  237. </ItemsControl>
  238. </ScrollViewer>
  239. </Grid>
  240. </Border>
  241. <GridSplitter
  242. Grid.Row="2"
  243. Height="2"
  244. HorizontalAlignment="Stretch"
  245. Background="Blue" />
  246. </Grid>
  247. </Grid>
  248. </Grid>
  249. </Window>