终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

304 rindas
14 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 OpenProjectCommand}"
  119. Content="打开" />
  120. <Button
  121. Width="60"
  122. Margin="5"
  123. Command="{Binding RunCommand}"
  124. Content="运行" />
  125. <Button
  126. Width="60"
  127. Margin="5"
  128. Command="{Binding GengrateCommand}"
  129. Content="生成" />
  130. <Button
  131. Width="60"
  132. Margin="5"
  133. Command="{Binding OpenVarManagerCommand}"
  134. Content="变量管理" />
  135. </StackPanel>
  136. <Grid Grid.Row="1">
  137. <Grid.ColumnDefinitions>
  138. <ColumnDefinition Width="150" />
  139. <ColumnDefinition Width="5" />
  140. <ColumnDefinition />
  141. </Grid.ColumnDefinitions>
  142. <Border BorderBrush="Blue" BorderThickness="2">
  143. <Grid>
  144. <Grid.RowDefinitions>
  145. <RowDefinition Height="20" />
  146. <RowDefinition />
  147. </Grid.RowDefinitions>
  148. <TextBlock
  149. Margin="5,0,0,0"
  150. HorizontalAlignment="Left"
  151. VerticalAlignment="Center"
  152. Text="{Binding Head}">
  153. <TextBlock.ContextMenu>
  154. <ContextMenu>
  155. <MenuItem Command="{Binding NewPageCommand}" Header="新建页面" />
  156. </ContextMenu>
  157. </TextBlock.ContextMenu>
  158. </TextBlock>
  159. <ScrollViewer
  160. Grid.Row="1"
  161. HorizontalScrollBarVisibility="Hidden"
  162. VerticalScrollBarVisibility="Hidden">
  163. <ItemsControl ItemsSource="{Binding Pages}">
  164. <ItemsControl.ItemTemplate>
  165. <DataTemplate>
  166. <Grid>
  167. <RadioButton
  168. Command="{Binding DataContext.SelectedPageCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  169. CommandParameter="{Binding}"
  170. Content="{Binding}"
  171. GroupName="All"
  172. Style="{StaticResource RadioMiniButtonStyle}">
  173. <!--<RadioButton.ContextMenu>
  174. <ContextMenu ItemsSource="{Binding DataContext}">
  175. <MenuItem
  176. Command="{Binding DataContext.RemovePageCommand, RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5, Mode=FindAncestor}}"
  177. CommandParameter="{Binding}"
  178. Header="删除页面" />
  179. <MenuItem
  180. Command="{Binding DataContext.SetStartPageCommand,RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5,Mode=FindAncestor}}"
  181. CommandParameter="{Binding}"
  182. Header="设为启动界面" />
  183. <MenuItem
  184. Command="{Binding DataContext.ReNameCommand, RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5, Mode=FindAncestor}}"
  185. CommandParameter="{Binding}"
  186. Header="重命名" />
  187. </ContextMenu>
  188. </RadioButton.ContextMenu>-->
  189. </RadioButton>
  190. <Grid.ContextMenu>
  191. <ContextMenu ItemsSource="{Binding DataContext}">
  192. <MenuItem
  193. Command="{Binding DataContext.RemovePageCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
  194. CommandParameter="{Binding}"
  195. Header="删除页面" />
  196. <MenuItem
  197. Command="{Binding DataContext.SetStartPageCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
  198. CommandParameter="{Binding}"
  199. Header="设为启动界面" />
  200. <MenuItem
  201. Command="{Binding DataContext.ReNameCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
  202. CommandParameter="{Binding}"
  203. Header="重命名" />
  204. </ContextMenu>
  205. </Grid.ContextMenu>
  206. </Grid>
  207. </DataTemplate>
  208. </ItemsControl.ItemTemplate>
  209. </ItemsControl>
  210. </ScrollViewer>
  211. </Grid>
  212. </Border>
  213. <GridSplitter
  214. Grid.Row="2"
  215. Width="2"
  216. VerticalAlignment="Stretch"
  217. Background="Blue" />
  218. <Grid
  219. Name="gr"
  220. Grid.Row="1"
  221. Grid.Column="2"
  222. Background="Transparent">
  223. <Grid.RowDefinitions>
  224. <RowDefinition Height="30" />
  225. <RowDefinition />
  226. <RowDefinition Height="2" />
  227. <RowDefinition Height="100" />
  228. </Grid.RowDefinitions>
  229. <ContentControl
  230. Grid.Row="1"
  231. Width="auto"
  232. Height="auto"
  233. Margin="0,0,0,5"
  234. Content="{Binding MainContent}" />
  235. <Border
  236. Grid.Row="2"
  237. Grid.RowSpan="2"
  238. Margin="-7,0,0,0"
  239. BorderBrush="Blue"
  240. BorderThickness="2">
  241. <Grid Margin="5,5,0,0">
  242. <ScrollViewer>
  243. <ItemsControl ItemsSource="{Binding Message}">
  244. <ItemsControl.ItemTemplate>
  245. <DataTemplate>
  246. <Grid>
  247. <TextBlock
  248. FontSize="16"
  249. Foreground="Blue"
  250. Text="{Binding}" />
  251. </Grid>
  252. </DataTemplate>
  253. </ItemsControl.ItemTemplate>
  254. </ItemsControl>
  255. </ScrollViewer>
  256. </Grid>
  257. </Border>
  258. <GridSplitter
  259. Grid.Row="2"
  260. Height="2"
  261. HorizontalAlignment="Stretch"
  262. Background="Blue" />
  263. </Grid>
  264. </Grid>
  265. </Grid>
  266. </Window>