|
- <UserControl x:Class="BPASmart.RecipeManagement.View.OrderManager"
- 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:BPASmart.RecipeManagement.View"
- xmlns:vm ="clr-namespace:BPASmart.RecipeManagement.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800" Background="Transparent">
- <UserControl.DataContext>
- <vm:OrderManagerViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style TargetType="ListBoxItem">
- <Setter Property="Margin" Value="2"/>
- <Setter Property="FontSize" Value="22"/>
- <Setter Property="FontWeight" Value="Black"/>
- <Setter Property="Background" Value="#104E8B"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListBoxItem">
- <Border BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}">
- <Grid HorizontalAlignment="Center" Margin="10 ">
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Row="0"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="配方:" />
- <TextBlock
- Grid.Row="1"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="数量:" />
- <TextBlock
- Grid.Row="2"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="已完成:" />
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="{Binding Name}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="1"
- Margin="5,0,0,0"
-
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="{Binding RecipeCount}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="1"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="Orange"
- Text="" />
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="ListViewItem" >
- <Setter Property="Margin" Value="10"/>
- <Setter Property="Background" Value="#104E8B"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <Border x:Name="mborder" BorderBrush="#009AC0" BorderThickness="5,5,5,5" CornerRadius="5,5,5,5" Margin="10"
- Background="#104E8B">
- <Grid
- Background="Transparent"
- Name="tt"
- Height="250"
- Width="300"
- Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition Height="*" />
- <RowDefinition Height="2" />
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
- <TextBlock
- Grid.Row="0"
- Margin="2,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="18"
- Foreground="White"
- Text="下单时间: " />
- <TextBlock
- Grid.Row="0"
- Margin="2,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="18"
- Foreground="White"
- Text="{Binding OrderdateTime}" />
- </StackPanel>
-
- <ScrollViewer
- Grid.Row="1"
- Margin="20,10"
- VerticalAlignment="Top"
- Background="#104E8B"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Auto">
- <ListBox ItemsSource="{Binding Recipes}" FontFamily="楷体" Background="#104E8B" >
-
- </ListBox>
-
- </ScrollViewer>
- <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Content="执行订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
- Style="{DynamicResource ButtonStyle}"
- Command="{Binding }"
- />
- <Button Content="删除订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
- Style="{DynamicResource ButtonStyle}"
- Command="{Binding }"
- CommandParameter="{Binding}"/>
- </StackPanel>
- </Grid>
-
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" Value="#D2B48C" TargetName="mborder"/>
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
-
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40"/>
- <RowDefinition />
- </Grid.RowDefinitions>
- <Button Content="创建订单" Width="100" Height="30" HorizontalAlignment="Right" Margin="10,0" Style="{DynamicResource ButtonStyle}"
- Command="{Binding CreateOrderCommand}"/>
- <ListView Grid.Row="1" Background="Transparent" Margin="10"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding orders}" >
-
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Margin="10"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListView>
- </Grid>
- </UserControl>
|