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

272 lines
18 KiB

  1. <UserControl x:Class="BPASmartClient.MorkTM.View.Debug"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.MorkTM.View"
  7. xmlns:vm="clr-namespace:BPASmartClient.MorkTM.ViewModel"
  8. xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
  9. mc:Ignorable="d"
  10. d:DesignHeight="800" d:DesignWidth="1000"
  11. Name="调试界面">
  12. <UserControl.DataContext>
  13. <vm:DebugViewModel/>
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <Style x:Key="buttonNormal" TargetType="{x:Type Button}">
  17. <Setter Property="FocusVisualStyle">
  18. <Setter.Value>
  19. <Style>
  20. <Setter Property="Control.Template">
  21. <Setter.Value>
  22. <ControlTemplate>
  23. <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
  24. </ControlTemplate>
  25. </Setter.Value>
  26. </Setter>
  27. </Style>
  28. </Setter.Value>
  29. </Setter>
  30. <Setter Property="Background" Value="#58B0ED"/>
  31. <Setter Property="BorderBrush" Value="#FF707070"/>
  32. <Setter Property="Foreground" Value="White"/>
  33. <Setter Property="FontWeight" Value="Bold"/>
  34. <Setter Property="BorderThickness" Value="0"/>
  35. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  36. <Setter Property="VerticalContentAlignment" Value="Center"/>
  37. <Setter Property="Padding" Value="1"/>
  38. <Setter Property="Template">
  39. <Setter.Value>
  40. <ControlTemplate TargetType="{x:Type Button}">
  41. <Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  42. <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  43. </Border>
  44. <ControlTemplate.Triggers>
  45. <Trigger Property="IsMouseOver" Value="True">
  46. <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
  47. <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
  48. </Trigger>
  49. <Trigger Property="IsPressed" Value="True">
  50. <Setter Property="Background" TargetName="border" Value="#58B0ED "/>
  51. <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
  52. </Trigger>
  53. <Trigger Property="ToggleButton.IsChecked" Value="True">
  54. <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
  55. <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
  56. </Trigger>
  57. <Trigger Property="IsEnabled" Value="False">
  58. <Setter Property="Background" TargetName="border" Value="#58B0ED"/>
  59. <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
  60. <Setter Property="Foreground" Value="White"/>
  61. </Trigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <!--Combox-->
  68. <Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
  69. <Setter Property="Background" Value="White"/>
  70. <Setter Property="ItemContainerStyle">
  71. <Setter.Value>
  72. <!--ComBoxItem-->
  73. <Style TargetType="ComboBoxItem">
  74. <Setter Property="MinHeight" Value="22"></Setter>
  75. <Setter Property="MinWidth" Value="60"></Setter>
  76. <Setter Property="Template">
  77. <Setter.Value>
  78. <ControlTemplate TargetType="ComboBoxItem">
  79. <Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0" BorderBrush="#81D779" >
  80. <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
  81. </Border>
  82. <ControlTemplate.Triggers>
  83. <Trigger Property="IsMouseOver" Value="True">
  84. <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
  85. </Trigger>
  86. <Trigger Property="IsHighlighted" Value="True">
  87. <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
  88. </Trigger>
  89. </ControlTemplate.Triggers>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. </Setter.Value>
  95. </Setter>
  96. <Setter Property="Template">
  97. <Setter.Value>
  98. <ControlTemplate TargetType="{x:Type ComboBox}">
  99. <Border BorderThickness="0" CornerRadius="3" Width="100" Height="30" Background="{TemplateBinding Background}" >
  100. <Grid >
  101. <Grid.ColumnDefinitions>
  102. <ColumnDefinition Width="3*"/>
  103. <ColumnDefinition Width="*"/>
  104. </Grid.ColumnDefinitions>
  105. <Grid Grid.Column="0" x:Name="grid">
  106. <ToggleButton
  107. Width="{Binding ElementName=grid,Path=ActualWidth}"
  108. Height="{Binding ElementName=grid, Path=ActualHeight}"
  109. Content="{TemplateBinding Text}" VerticalAlignment="Center"
  110. HorizontalAlignment="Left" Margin="5,0,0,0"
  111. BorderThickness="0"
  112. Foreground="{TemplateBinding Foreground}"
  113. Background="{TemplateBinding Background}"
  114. IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"
  115. >
  116. <ToggleButton.Style >
  117. <Style TargetType="ToggleButton">
  118. <Setter Property="Background" Value="White"/>
  119. <Setter Property="Template">
  120. <Setter.Value>
  121. <ControlTemplate TargetType="ToggleButton">
  122. <Border Background="{TemplateBinding Background}" BorderThickness="0" >
  123. <TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
  124. </Border>
  125. </ControlTemplate>
  126. </Setter.Value>
  127. </Setter>
  128. <Style.Triggers>
  129. <Trigger Property="IsMouseOver" Value="True">
  130. <Setter Property="Background" Value="White"/>
  131. </Trigger>
  132. <Trigger Property="IsMouseOver" Value="False">
  133. <Setter Property="Background" Value="White"/>
  134. </Trigger>
  135. </Style.Triggers>
  136. </Style>
  137. </ToggleButton.Style>
  138. </ToggleButton>
  139. </Grid>
  140. <Grid Grid.Column="1" >
  141. <ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  142. Foreground="{TemplateBinding Foreground}"
  143. ClickMode="Press">
  144. <ToggleButton.Style>
  145. <Style TargetType="ToggleButton">
  146. <Setter Property="Background" Value="White"/>
  147. <Setter Property="Template">
  148. <Setter.Value>
  149. <ControlTemplate TargetType="ToggleButton">
  150. <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
  151. <Grid>
  152. <TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="&#xf02a9;" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
  153. <TextBlock.RenderTransform>
  154. <TransformGroup>
  155. <ScaleTransform/>
  156. <SkewTransform/>
  157. <RotateTransform/>
  158. <TranslateTransform/>
  159. </TransformGroup>
  160. </TextBlock.RenderTransform>
  161. </TextBlock>
  162. </Grid>
  163. </Border>
  164. <ControlTemplate.Triggers>
  165. <Trigger Property="IsChecked" Value="True">
  166. </Trigger>
  167. <EventTrigger RoutedEvent="Checked">
  168. <BeginStoryboard>
  169. <Storyboard >
  170. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
  171. <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
  172. <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
  173. </DoubleAnimationUsingKeyFrames>
  174. </Storyboard>
  175. </BeginStoryboard>
  176. </EventTrigger>
  177. <EventTrigger RoutedEvent="Unchecked">
  178. <BeginStoryboard>
  179. <Storyboard >
  180. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
  181. <EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
  182. <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
  183. </DoubleAnimationUsingKeyFrames>
  184. </Storyboard>
  185. </BeginStoryboard>
  186. </EventTrigger>
  187. </ControlTemplate.Triggers>
  188. </ControlTemplate>
  189. </Setter.Value>
  190. </Setter>
  191. </Style>
  192. </ToggleButton.Style>
  193. </ToggleButton>
  194. </Grid>
  195. <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
  196. <Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
  197. <Border.Effect>
  198. <DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
  199. </Border.Effect>
  200. <ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
  201. <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
  202. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
  203. </ScrollViewer>
  204. </Border>
  205. </Popup>
  206. </Grid>
  207. <Border.Effect>
  208. <DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="5"/>
  209. </Border.Effect>
  210. </Border>
  211. </ControlTemplate>
  212. </Setter.Value>
  213. </Setter>
  214. </Style>
  215. </UserControl.Resources>
  216. <Grid>
  217. <Grid.ColumnDefinitions>
  218. <ColumnDefinition Width="*"/>
  219. <ColumnDefinition Width="*"/>
  220. </Grid.ColumnDefinitions>
  221. <Grid.RowDefinitions>
  222. <RowDefinition Height="2*"/>
  223. <RowDefinition Height="2*"/>
  224. <RowDefinition Height="10*"/>
  225. <RowDefinition Height="10*"/>
  226. </Grid.RowDefinitions>
  227. <StackPanel Orientation="Horizontal">
  228. <TextBlock Text="出料口" Margin="10,0"/>
  229. <ComboBox ItemsSource="{Binding Materials}" Margin="20,0" Width="120 " Style="{StaticResource cmbstyle}" />
  230. <TextBlock Text="出料量" Margin="10,0,10,0"/>
  231. <TextBox Text="{Binding MaertialsWight}" Width="60" Margin="10,0"/>
  232. <Button Content="出料" Margin="40,0" Command="{Binding OutMaterials}" Style="{StaticResource buttonNormal}"
  233. Width="80" Height="20"/>
  234. </StackPanel>
  235. <Button Grid.Column="1" Style="{StaticResource buttonNormal}" Height="20"
  236. Width="120" Margin="20,0" HorizontalAlignment="Left"
  237. Content="转盘转动" Command="{Binding TurnOn}" />
  238. <Border BorderBrush="White" BorderThickness="2" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2"/>
  239. <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
  240. <TextBlock Text="奶茶" Margin="20,0"/>
  241. <ComboBox ItemsSource="{Binding}" Width="120"/>
  242. </StackPanel>
  243. <Grid Grid.Row="2">
  244. <Grid.ColumnDefinitions>
  245. <ColumnDefinition Width="*"/>
  246. </Grid.ColumnDefinitions>
  247. <Grid.RowDefinitions>
  248. <RowDefinition Height="4*"/>
  249. <RowDefinition Height="*"/>
  250. </Grid.RowDefinitions>
  251. <Viewbox Stretch="Fill">
  252. </Viewbox>
  253. <Button Content="制作"
  254. Grid.Row="3" Grid.ColumnSpan="4"
  255. HorizontalAlignment="Center"/>
  256. </Grid>
  257. </Grid>
  258. </UserControl>