|
- <UserControl
- x:Class="BPASmartClient.SmallBatchingSystem.Views.RecipeView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:con="clr-namespace:BPASmartClient.SmallBatchingSystem.Converter"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:BPASmartClient.SmallBatchingSystem.ViewModels"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:RecipeViewModel />
- </UserControl.DataContext>
-
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
- <Button
- Width="150"
- Height="40"
- Margin="10,0,10,0"
- Command="{Binding AddCommand}"
- Content="新建配方"
- FontSize="20"
- Style="{StaticResource ImageButtonStyle}" />
- <Button
- Width="150"
- Height="40"
- Margin="10,0,10,0"
- Command="{Binding SaveCommand}"
- Content="保存配方"
- FontSize="20"
- Style="{StaticResource ImageButtonStyle}" />
- </StackPanel>
-
- <Grid Grid.Row="1">
-
- <ListBox
- Grid.Row="2"
- Margin="5"
- VerticalAlignment="Top"
- Background="Transparent"
- BorderThickness="0"
- ItemsSource="{Binding RecipeInfoModels}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <!--<UniformGrid
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Columns="8" />-->
- <WrapPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
-
- <Grid
- Name="tt"
- Width="180"
- Height="220"
- Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition Height="20" />
- <RowDefinition Height="128" />
- <RowDefinition Height="2" />
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
-
- <Image
- Grid.RowSpan="5"
- Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
- Stretch="Fill" />
-
- <TextBlock
- Grid.Row="0"
- Margin="2,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="18"
- Foreground="#FF2AB2E7"
- Text="{Binding RecipeName}" />
-
- <TextBlock
- Grid.Row="1"
- Margin="5,0,0,0"
- VerticalAlignment="Top"
- Foreground="#FF2AB2E7"
- Text="配方信息:" />
-
- <ScrollViewer
- Grid.Row="2"
- VerticalAlignment="Top"
- Background="Transparent"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <ItemsControl ItemsSource="{Binding SiloInfoModels}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Width="150">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="0.1*" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="#aa2AB2E7"
- Text="{Binding SiloName}" />
-
- <TextBlock
- Grid.Column="1"
- Margin="1,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="#aa2AB2E7"
- Text=":" />
-
- <TextBlock
- Grid.Column="2"
- Margin="5,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Foreground="#aa2AB2E7"
- Text="{Binding SiloWeight}" />
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- </ScrollViewer>
-
- <Image
- Grid.Row="3"
- Width="{Binding ElementName=tt, Path=ActualWidth}"
- Height="2"
- VerticalAlignment="Bottom"
- Source="/BPASmartClient.CustomResource;component/Image/直线.png"
- Stretch="Fill" />
-
- <Grid
- Name="gr"
- Grid.Row="4"
- Height="30"
- Margin="0,0,0,10"
- VerticalAlignment="Bottom"
- Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Image
- Grid.ColumnSpan="2"
- Width="{Binding ElementName=gr, Path=ActualWidth}"
- Height="2"
- VerticalAlignment="Top"
- Source="/BPASmartClient.CustomResource;component/Image/直线.png" />
-
- <pry:IcoButton
- Width="{Binding ElementName=gr, Path=ActualWidth}"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- Margin="4,4,3,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="#11F53F62"
- BorderThickness="0"
- Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
- CommandParameter="{Binding RecipeName}"
- Content="删除"
- EnterBackground="#22F53F62"
- FontStyle="Normal"
- Foreground="#FFF53F62"
- IcoText=""
- Style="{StaticResource IcoButtonStyle}" />
-
- <pry:IcoButton
- Grid.Column="1"
- Width="{Binding ElementName=gr, Path=ActualWidth}"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- Margin="3,4,4,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="#112AB2E7"
- BorderThickness="0"
- Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
- CommandParameter="{Binding RecipeName}"
- Content="编辑"
- EnterBackground="#222AB2E7"
- Foreground="#FF2AB2E7"
- IcoText=""
- Style="{StaticResource IcoButtonStyle}" />
-
- </Grid>
- <!--</StackPanel>-->
- </Grid>
-
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
-
-
- </Grid>
-
-
- </Grid>
-
- </UserControl>
|