|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <UserControl x:Class="BPASmartClient.MorkTM.View.Debug"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.MorkTM.View"
- xmlns:vm="clr-namespace:BPASmartClient.MorkTM.ViewModel"
- xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
- mc:Ignorable="d"
- d:DesignHeight="800" d:DesignWidth="1000"
- Name="调试界面">
- <UserControl.DataContext>
- <vm:DebugViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style x:Key="buttonNormal" TargetType="{x:Type Button}">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Background" Value="#58B0ED"/>
- <Setter Property="BorderBrush" Value="#FF707070"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="FontWeight" Value="Bold"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Padding" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <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}"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter Property="Background" TargetName="border" Value="#58B0ED "/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
- </Trigger>
- <Trigger Property="ToggleButton.IsChecked" Value="True">
- <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Background" TargetName="border" Value="#58B0ED"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
- <Setter Property="Foreground" Value="White"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--Combox-->
- <Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
- <Setter Property="Background" Value="White"/>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <!--ComBoxItem-->
- <Style TargetType="ComboBoxItem">
- <Setter Property="MinHeight" Value="22"></Setter>
- <Setter Property="MinWidth" Value="60"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBoxItem">
- <Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0" BorderBrush="#81D779" >
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
- </Trigger>
- <Trigger Property="IsHighlighted" Value="True">
- <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Border BorderThickness="0" CornerRadius="3" Width="100" Height="30" Background="{TemplateBinding Background}" >
- <Grid >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0" x:Name="grid">
- <ToggleButton
- Width="{Binding ElementName=grid,Path=ActualWidth}"
- Height="{Binding ElementName=grid, Path=ActualHeight}"
- Content="{TemplateBinding Text}" VerticalAlignment="Center"
- HorizontalAlignment="Left" Margin="5,0,0,0"
- BorderThickness="0"
- Foreground="{TemplateBinding Foreground}"
- Background="{TemplateBinding Background}"
- IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"
- >
- <ToggleButton.Style >
- <Style TargetType="ToggleButton">
- <Setter Property="Background" Value="White"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border Background="{TemplateBinding Background}" BorderThickness="0" >
- <TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="White"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Setter Property="Background" Value="White"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </ToggleButton.Style>
- </ToggleButton>
- </Grid>
-
- <Grid Grid.Column="1" >
- <ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Foreground="{TemplateBinding Foreground}"
- ClickMode="Press">
- <ToggleButton.Style>
- <Style TargetType="ToggleButton">
- <Setter Property="Background" Value="White"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
- <Grid>
- <TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="󰊩" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
- <TextBlock.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </TextBlock.RenderTransform>
- </TextBlock>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
-
- </Trigger>
- <EventTrigger RoutedEvent="Checked">
- <BeginStoryboard>
- <Storyboard >
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
- <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
-
- <EventTrigger RoutedEvent="Unchecked">
- <BeginStoryboard>
- <Storyboard >
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
- <EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ToggleButton.Style>
- </ToggleButton>
- </Grid>
- <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
- <Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
- <Border.Effect>
- <DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
- </Border.Effect>
- <ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
- </ScrollViewer>
- </Border>
- </Popup>
- </Grid>
-
-
- <Border.Effect>
- <DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="5"/>
- </Border.Effect>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
-
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
-
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="2*"/>
- <RowDefinition Height="2*"/>
- <RowDefinition Height="10*"/>
- <RowDefinition Height="10*"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="出料口" Margin="10,0"/>
- <ComboBox ItemsSource="{Binding Materials}" Margin="20,0" Width="120 " Style="{StaticResource cmbstyle}" />
- <TextBlock Text="出料量" Margin="10,0,10,0"/>
- <TextBox Text="{Binding MaertialsWight}" Width="60" Margin="10,0"/>
- <Button Content="出料" Margin="40,0" Command="{Binding OutMaterials}" Style="{StaticResource buttonNormal}"
- Width="80" Height="20"/>
- </StackPanel>
-
- <Button Grid.Column="1" Style="{StaticResource buttonNormal}" Height="20"
- Width="120" Margin="20,0" HorizontalAlignment="Left"
- Content="转盘转动" Command="{Binding TurnOn}" />
- <Border BorderBrush="White" BorderThickness="2" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2"/>
- <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="奶茶" Margin="20,0"/>
- <ComboBox ItemsSource="{Binding}" Width="120"/>
- </StackPanel>
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
-
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="4*"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Viewbox Stretch="Fill">
-
- </Viewbox>
- <Button Content="制作"
- Grid.Row="3" Grid.ColumnSpan="4"
- HorizontalAlignment="Center"/>
- </Grid>
-
-
- </Grid>
- </UserControl>
|