|
- <Window
- x:Class="BPASmartClient.DosingSystem.View.NewRecipeView"
- 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:local="clr-namespace:BPASmartClient.DosingSystem.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
- xmlns:i ="http://schemas.microsoft.com/expression/2010/interactivity"
- Title="NewRecipeView"
- Width="550"
- Height="600"
- AllowsTransparency="True"
- Background="{x:Null}"
- Topmost="True"
- WindowStartupLocation="CenterScreen"
- WindowStyle="None"
- mc:Ignorable="d">
-
- <Window.DataContext>
- <vm:NewRecipeViewModel />
- </Window.DataContext>
-
- <Window.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
-
- <ResourceDictionary>
- <!--#region ListBox样式-->
- <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="FontSize" Value="20" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="border" CornerRadius="8">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
- </ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </Window.Resources>
-
- <Border
- Name="br"
- BorderBrush="#0CADF5"
- BorderThickness="2">
- <Border.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
- <!--<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗2.png" />-->
- </Border.Background>
- <Grid>
-
- <!--<Grid.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗.png" />
- </Grid.Background>-->
-
- <Grid.RowDefinitions>
- <RowDefinition Height="5" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <!--<Button
- Name="btClose"
- Margin="0,0,5,0"
- Padding="10,5"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="Transparent"
- BorderThickness="0"
- Content="X"
- FontSize="18"
- Foreground="White" />
-
- <Border BorderBrush="#88DDDDDD" BorderThickness="0,0,0,1" />-->
-
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="40" />
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
- <TextBlock
- Margin="10,0,0,0"
- Background="Transparent"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="请输入配方名称:"
- />
- <TextBlock
- Margin="100,0,0,0"
- Background="Transparent"
- Text="配方总量:"
- Foreground="#FF2AB2E7"
- />
- <TextBox
- Width="160"
- Height="30"
- Margin="0,0,7,0"
- FontSize="16"
- IsReadOnly="True"
- Text="{Binding All_RawMt_weight}"
- />
- </StackPanel>
-
-
- <TextBlock
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- Background="Transparent"
- FontSize="16"
- Foreground="Red"
- Text="{Binding ErrorInfo}" />
-
- <StackPanel
- Grid.Row="1"
- Margin="10,0,0,0"
- Orientation="Horizontal">
-
- <TextBox
- Grid.Column="1"
- Width="200"
- Height="30"
- Margin="0,0,7,0"
- FontSize="16"
- Text="{Binding RecipeName}" />
-
- <Button
- Width="148"
- Height="30"
- Margin="0,0,7,0"
- Command="{Binding AddCommand}"
- Content="添加原料"
- Cursor="Hand" />
-
- <Button
- Width="80"
- Height="30"
- Command="{Binding SaveCommand}"
- Content="确认" />
-
- <Button
- Name="btClose"
- Width="80"
- Height="30"
- Margin="7,0,0,0"
- Content="取消" />
-
- </StackPanel>
-
- <!--#region 表格标题栏设置-->
- <Grid
- Grid.Row="2"
- Margin="5,0"
- Background="#ff0C255F">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource TitleTextblockStyle}"
- Text="原料名称" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="桶号" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource TitleTextblockStyle}"
- Text="重量" />
-
- <Grid Grid.Column="3">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0" />
-
- </Grid>
- <!--#endregion-->
-
- <ScrollViewer
- Grid.Row="3"
- Margin="5,0"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding RawMaterials}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton GroupName="all">
- <RadioButton.Template>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Height="35">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- </Grid.ColumnDefinitions>
-
- <ComboBox
- Name="cb"
- Grid.Column="0"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- VerticalAlignment="Center"
- BorderBrush="#FF074B92"
- BorderThickness="1"
- FontFamily="楷体"
- FontSize="20"
- Foreground="#FF2AB2E7"
- IsEditable="False"
- ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- SelectedIndex="{Binding SelectIndex}"
- SelectionChanged="cb_SelectionChanged"
- Style="{StaticResource ComboBoxStyle}"
- Text="{Binding RawMaterialName}" />
-
- <TextBox
- Grid.Column="1"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="{Binding Loc}" />
-
- <TextBox
- Name="tb"
- Grid.Column="2"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="{Binding RawMaterialWeight}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="TextChanged">
- <i:InvokeCommandAction Command="{Binding DataContext.TextChanged, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"/>
- </i:EventTrigger>
- <i:EventTrigger EventName="LostFocus">
- <i:InvokeCommandAction Command="{Binding DataContext.TextChanged, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"/>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </TextBox>
-
- <TextBlock
- Grid.Column="2"
- Margin="0,0,8,4"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="g" />
-
- <Button
- Grid.Column="3"
- Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- CommandParameter="{Binding RawMaterialId}"
- Content="删除"
- FontSize="16"
- Style="{StaticResource ControlButtonStyle}" />
-
- </Grid>
-
-
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
-
- </Grid>
-
- </Grid>
- </Border>
- </Window>
|