|
- <Window x:Class="BPASmartClient.RecipeManagement.View.RecipesConfigure"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:BPASmartClient.RecipeManagement.View"
- xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel"
- mc:Ignorable="d"
- Title="RecipesConfigure" Height="600" Width="600" WindowStartupLocation="CenterScreen" WindowStyle="None" Background="#01003B" MouseLeftButtonDown="Window_MouseLeftButtonDown"
- AllowsTransparency="True" Foreground="#FF2AB2E7">
- <Window.DataContext>
- <vm:RecipesConfigureViewModel/>
- </Window.DataContext>
- <Window.Resources>
-
-
-
- </Window.Resources>
- <Border >
- <Border.Background>
- <ImageBrush ImageSource="../Image/边框元素.png" Stretch="Fill"/>
- </Border.Background>
-
- <Grid Background="Transparent" Margin="40,10">
- <Grid.RowDefinitions>
- <RowDefinition Height="40"/>
- <RowDefinition Height="50"/>
- <RowDefinition />
- <RowDefinition Height="30"/>
- <RowDefinition Height="60"/>
- <RowDefinition Height="26"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="103*" />
- <ColumnDefinition Width="147*" />
- <ColumnDefinition Width="100*" />
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Row="1" Orientation="Horizontal" Grid.ColumnSpan="3 " HorizontalAlignment="Center">
- <TextBlock Text="配方名称:" FontSize="16"
- HorizontalAlignment="Right" VerticalAlignment="Center" Margin="50,0,10,0"/>
- <TextBox Text="{Binding RecipeName}" FontSize="16" Grid.Column="1" Width="160" Background="Transparent" Foreground="Orange"
- BorderBrush="#FF2AB2E7"
- VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"
- VerticalContentAlignment="Center"/>
- <Button Grid.Column="2"
- Content="添加原料"
- FontSize="16" Width="90" Height="22" Margin="10" Style="{DynamicResource CommonButton}"
- Command="{Binding AddMaterailsCommand}"/>
- </StackPanel>
-
- <ScrollViewer Grid.ColumnSpan="3"
- Grid.Row="2"
- Margin="30,10"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Auto">
- <ItemsControl ItemsSource="{Binding recipeMaterials}" >
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton GroupName="all">
- <RadioButton.Template>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Height="40">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
-
- <ComboBox
- Name="cb"
- Grid.Column="0"
- Margin="3,1"
- Foreground="#FF2AB2E7"
- VerticalAlignment="Center"
- HorizontalAlignment="Right"
- Width="200"
- FontFamily="楷体"
- FontSize="20"
- IsEditable="False"
- SelectedValuePath="Key" DisplayMemberPath="Value"
- ItemsSource="{Binding DataContext.materialsName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- SelectedValue="{Binding ID}"
- />
- <StackPanel
- Grid.Column="1"
- VerticalAlignment="Center" HorizontalAlignment="Right"
- Orientation="Horizontal">
- <TextBox
- Name="tb"
- Grid.Column="1"
- Width="50"
- Height="29"
- Margin="10,1"
- VerticalAlignment="Center"
- Style="{DynamicResource CommonTextBox}"
- FontSize="20"
- Text="{Binding MaterialWeight}" />
-
- <TextBlock
- Grid.Column="1"
- Margin="0,0,5,4"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="g" />
-
- </StackPanel>
-
- <Button
- Grid.Column="2"
- Width="70"
- Height="25"
- Margin="15,0,0,0"
- FontSize="16"
- BorderBrush="#FF2AB2E7"
- BorderThickness="1"
- HorizontalAlignment="Left"
- Style="{DynamicResource DeleteButton}"
- Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- CommandParameter="{Binding ID}"
- Content="删 除" />
-
- </Grid>
-
-
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
-
- <TextBlock Text="{Binding ErrorMessage}" Grid.Row="2" Grid.ColumnSpan="3"
- Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- <StackPanel Grid.Row="4" Grid.ColumnSpan="3" Orientation="Horizontal"
- HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Content="保存" FontSize="18" Width="120" Height="24" Margin="10" Style="{DynamicResource ButtonStyle}"
- Command="{Binding SaveCommand}"/>
- <Button Content="取消" FontSize="18" Width="120" Height="24" Margin="10" Style="{DynamicResource ButtonStyle}"
- Click="Button_Click"/>
-
-
- </StackPanel>
- </Grid>
- </Border>
- </Window>
|