|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <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"
- 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>
-
- <TextBlock
- Margin="10,0,0,0"
- Background="Transparent"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="请输入配方名称:" />
-
- <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}" />
-
- <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>
|