|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <UserControl x:Class="BPASmartClient.MorkS.View.GoodsMakeView"
- 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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:local="clr-namespace:BPASmartClient.MorkS.View"
- xmlns:vm="clr-namespace:BPASmartClient.MorkS.ViewModel"
- mc:Ignorable="d"
- Name="制作界面"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:GoodsMakeViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style x:Key="BtnStyle" TargetType="Button">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}" >
- <Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
- <ContentPresenter x:Name="contentPresenter" 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="#FF3225"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter Property="Background" TargetName="border" Value="IndianRed"/>
-
- </Trigger>-->
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
-
- </Style.Triggers>
- </Style>
- <Style x:Key="SwitchToggleButtonStyle1" TargetType="{x:Type ToggleButton}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Viewbox>
- <Grid x:Name="gr" Opacity="0.8">
- <Border
- x:Name="border2"
- Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- HorizontalAlignment="Left"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Background="Red"
- BorderBrush="{TemplateBinding BorderBrush}"
- CornerRadius="15">
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- Visibility="Collapsed" />
- </Border>
-
- <Ellipse
- Name="ell"
- Width="{TemplateBinding Height}"
- Height="{TemplateBinding Height}"
- Margin="0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Fill="#ddd" />
-
- <TextBlock
- Name="tb"
- Margin="34,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="White"
- Text="{TemplateBinding Content}" />
-
- </Grid>
- </Viewbox>
- <ControlTemplate.Triggers>
- <!-- 控件选中 -->
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="ell" Property="HorizontalAlignment" Value="Right" />
- <Setter TargetName="border2" Property="Background" Value="#FF2AB2E7" />
- <Setter TargetName="tb" Property="Margin" Value="0,0,45,0" />
- </Trigger>
-
- <!-- 控件未选中 -->
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="border2" Property="Background" Value="gray" />
- <Setter TargetName="tb" Property="HorizontalAlignment" Value="Right" />
- </Trigger>
-
- <!-- 鼠标进入 -->
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="1" />
- </Trigger>
-
- <!-- 控件禁用 -->
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="gr" Property="Opacity" Value="0.5" />
- </Trigger>
-
- <!-- 控件启用 -->
- <Trigger Property="IsEnabled" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="0.8" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50"/>
- <RowDefinition Height="30"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <UniformGrid Columns="2" HorizontalAlignment="Right" VerticalAlignment="Center">
- <Button Content="新增订单" Command="{Binding EditCommand}" Style="{StaticResource ButtonStyle}" FontSize="22" />
- <ToggleButton
- x:Name="togFire"
- Width="90"
- Height="30"
- Margin="0,6,5.5,3.5"
- Background="Transparent"
- Click="togFire_Click"
- Content="小程序"
- FontSize="18"
- Style="{StaticResource SwitchToggleButtonStyle1}" />
- </UniformGrid>
- <Grid Background="#FF2AB2E7" Name="formHead" Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="商品" Margin="3,0,4,0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White" />
- <GridSplitter Background="Transparent" Width="1" />
- <TextBlock Grid.Column="1" Margin="3,0,4,0" Text="面条位置" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
- <GridSplitter Grid.Column="1" Background="Transparent" Width="1"/>
- <TextBlock Grid.Column="2" Margin="3,0,4,0" Text="碗位置" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
- <GridSplitter Grid.Column="2" Background="Transparent" Width="1"/>
- <TextBlock Grid.Column="3" Margin="3,0,4,0" Text="操作" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
- </Grid>
- <ItemsControl Grid.Row="2" ItemsSource="{Binding GoodsModels}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Border BorderThickness="0,0,0,1" BorderBrush="#FF2AB2E7">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock Margin="0,8" Foreground="#2AB2E7" Text="{Binding GoodsName}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <TextBlock Grid.Column="1" Foreground="#2AB2E7" Text="{Binding NoodlesLoc}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <TextBlock Grid.Column="2" Foreground="#2AB2E7" Text="{Binding BowlLoc}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <UniformGrid Columns="2" Grid.Column="3">
- <Button IsEnabled="{Binding ElementName=togFire,Path=IsChecked}" Command="{Binding DataContext.SendOrderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding OrderNum}" HorizontalAlignment="Center" Background="Transparent"
- VerticalAlignment="Center" BorderThickness="0" Content="点击下单" FontSize="16" Cursor="Hand" Style="{StaticResource BtnStyle}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="Orange" />
- <GradientStop Offset="1.2" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
- <Button Command="{Binding DataContext.DeleteOrderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding OrderNum}" HorizontalAlignment="Center" Background="Transparent"
- VerticalAlignment="Center" BorderThickness="0" Content="删除订单" FontSize="16" Cursor="Hand" Style="{StaticResource BtnStyle}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="Orange" />
- <GradientStop Offset="1.2" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
- </UniformGrid>
- </Grid>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- </UserControl>
|