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

208 line
9.1 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. mc:Ignorable="d">
  14. <Window.DataContext>
  15. <local:MainWindowViewModel />
  16. </Window.DataContext>
  17. <Window.Resources>
  18. <!--#region 下拉列表单选按钮样式-->
  19. <Style x:Key="RadioMiniButtonStyle" TargetType="{x:Type RadioButton}">
  20. <Setter Property="Margin" Value="20,1,1,1" />
  21. <!--<Setter Property="Width" Value="160" />-->
  22. <!--<Setter Property="Height" Value="30" />-->
  23. <Setter Property="FontSize" Value="14" />
  24. <Setter Property="FontFamily" Value="粗体" />
  25. <Setter Property="VerticalContentAlignment" Value="Center" />
  26. <Setter Property="HorizontalContentAlignment" Value="left" />
  27. <Setter Property="BorderBrush" Value="Transparent" />
  28. <Setter Property="BorderThickness" Value="0" />
  29. <Setter Property="Background" Value="#ddd" />
  30. <Setter Property="HorizontalAlignment" Value="left" />
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type RadioButton}">
  34. <Grid
  35. x:Name="templateRoot"
  36. Background="Transparent"
  37. SnapsToDevicePixels="True">
  38. <Border x:Name="border2" />
  39. <ContentPresenter
  40. x:Name="contentPresenter"
  41. Margin="{TemplateBinding Padding}"
  42. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  43. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  44. Content="{TemplateBinding Content}"
  45. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  46. ContentTemplate="{TemplateBinding ContentTemplate}"
  47. Focusable="False"
  48. RecognizesAccessKey="True"
  49. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  50. </Grid>
  51. <ControlTemplate.Triggers>
  52. <Trigger Property="HasContent" Value="True">
  53. <Setter Property="FocusVisualStyle">
  54. <Setter.Value>
  55. <Style>
  56. <Setter Property="Control.Template">
  57. <Setter.Value>
  58. <ControlTemplate>
  59. <Rectangle
  60. Margin="14,0,0,0"
  61. SnapsToDevicePixels="True"
  62. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  63. StrokeDashArray="1 2"
  64. StrokeThickness="1" />
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. </Setter.Value>
  70. </Setter>
  71. <Setter Property="Padding" Value="4,-1,0,0" />
  72. </Trigger>
  73. <Trigger Property="IsChecked" Value="{x:Null}" />
  74. <Trigger Property="IsChecked" Value="true">
  75. <!--<Setter Property="Foreground" Value="White" />-->
  76. <Setter TargetName="border2" Property="Background" Value="red" />
  77. </Trigger>
  78. <Trigger Property="IsChecked" Value="false">
  79. <Setter TargetName="border2" Property="Background" Value="Transparent" />
  80. <!--<Setter Property="Foreground" Value="#4B8EC4" />-->
  81. </Trigger>
  82. <MultiTrigger>
  83. <MultiTrigger.Conditions>
  84. <Condition Property="IsChecked" Value="false" />
  85. <Condition Property="IsMouseOver" Value="True" />
  86. </MultiTrigger.Conditions>
  87. <MultiTrigger.Setters>
  88. <Setter TargetName="border2" Property="Background" Value="#55007acc" />
  89. </MultiTrigger.Setters>
  90. </MultiTrigger>
  91. </ControlTemplate.Triggers>
  92. </ControlTemplate>
  93. </Setter.Value>
  94. </Setter>
  95. </Style>
  96. <!--#endregion-->
  97. </Window.Resources>
  98. <Grid>
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="30" />
  101. <RowDefinition />
  102. </Grid.RowDefinitions>
  103. <StackPanel Orientation="Horizontal">
  104. <Button
  105. Width="60"
  106. Margin="5"
  107. Command="{Binding NewCommand}"
  108. Content="新建" />
  109. <Button
  110. Width="60"
  111. Margin="5"
  112. Command="{Binding NewCommand}"
  113. Content="保存" />
  114. <Button
  115. Width="60"
  116. Margin="5"
  117. Command="{Binding}"
  118. Content="打开" />
  119. <Button
  120. Width="60"
  121. Margin="5"
  122. Content="运行" />
  123. <Button
  124. Width="60"
  125. Margin="5"
  126. Command="{Binding OpenVarManagerCommand}"
  127. Content="变量管理" />
  128. </StackPanel>
  129. <Grid Grid.Row="1">
  130. <Grid.ColumnDefinitions>
  131. <ColumnDefinition Width="150" />
  132. <ColumnDefinition />
  133. </Grid.ColumnDefinitions>
  134. <Grid>
  135. <Grid.RowDefinitions>
  136. <RowDefinition Height="20" />
  137. <RowDefinition />
  138. </Grid.RowDefinitions>
  139. <TextBlock
  140. Margin="5,0,0,0"
  141. HorizontalAlignment="Left"
  142. VerticalAlignment="Center"
  143. Text="{Binding Head}">
  144. <TextBlock.ContextMenu>
  145. <ContextMenu>
  146. <MenuItem Command="{Binding NewPageCommand}" Header="新建页面" />
  147. </ContextMenu>
  148. </TextBlock.ContextMenu>
  149. </TextBlock>
  150. <ScrollViewer
  151. Grid.Row="1"
  152. HorizontalScrollBarVisibility="Hidden"
  153. VerticalScrollBarVisibility="Hidden">
  154. <ItemsControl ItemsSource="{Binding Pages}">
  155. <ItemsControl.ItemTemplate>
  156. <DataTemplate>
  157. <Grid>
  158. <RadioButton
  159. Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  160. CommandParameter="{Binding}"
  161. Content="{Binding}"
  162. GroupName="All"
  163. Style="{StaticResource RadioMiniButtonStyle}">
  164. <RadioButton.ContextMenu>
  165. <ContextMenu>
  166. <MenuItem Header="删除页面" />
  167. <MenuItem Header="设为启动界面" />
  168. <MenuItem Header="重命名" />
  169. </ContextMenu>
  170. </RadioButton.ContextMenu>
  171. </RadioButton>
  172. </Grid>
  173. </DataTemplate>
  174. </ItemsControl.ItemTemplate>
  175. </ItemsControl>
  176. </ScrollViewer>
  177. </Grid>
  178. <Canvas Name="cav" Grid.Column="1" Grid.Row="1">
  179. </Canvas>
  180. </Grid>
  181. </Grid>
  182. </Window>