|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- <Window
- x:Class="BPASmartClient.Academy.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.Academy.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.Academy.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-->
-
- <Style x:Key="closeBtn" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid Name="gr">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont"
- FontSize="30"
- Foreground="White"
- Text="" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Background" Value="#22009DFF" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="btn" TargetType="Button">
- <Setter Property="Background" Value="#064d87" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- Name="gr"
- Background="{TemplateBinding Background}"
- CornerRadius="5"
- Opacity="0.8">
- <ContentPresenter
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </Window.Resources>
-
- <Border
- Name="br"
- Background="Transparent"
- BorderBrush="#064d87"
- BorderThickness="2">
- <Grid Background="#061c43">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <Border BorderBrush="#064d87" BorderThickness="0,0,0,2">
- <Border.Background>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#064d87" />
- <GradientStop Offset="1" Color="#99064d87" />
- </LinearGradientBrush>
- </Border.Background>
- <TextBlock
- Margin="10,0,0,0"
- Foreground="White"
- Text="新建配方" />
- </Border>
-
- <Button
- Width="40"
- HorizontalAlignment="Right"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Click="btClose_Click"
- Style="{StaticResource closeBtn}" />
-
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="80" />
- <RowDefinition Height="30" />
- <RowDefinition />
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
-
- <Grid Grid.Row="0" Margin="5,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition />
- <ColumnDefinition Width="118" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <TextBlock
- Background="Transparent"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Text="请输入配方名称:" />
-
- <TextBox
- Grid.Column="1"
- Grid.ColumnSpan="2"
- Height="30"
- Margin="0,0,7,0"
- BorderThickness="2"
- CaretBrush="DeepSkyBlue"
- FontSize="16"
- Text="{Binding RecipeName}" />
-
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Left"
- Background="Transparent"
- FontSize="16"
- Foreground="Red"
- Text="{Binding ErrorInfo}" />
-
- <Button
- Grid.Row="1"
- Grid.Column="2"
- Width="118"
- Height="30"
- Command="{Binding AddCommand}"
- Content="添加原料"
- Cursor="Hand"
- Style="{StaticResource btn}" />
-
- </Grid>
-
- <!--#region 表格标题栏设置-->
- <Grid
- Grid.Row="1"
- 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"
- Grid.ColumnSpan="2"
- Style="{StaticResource TitleTextblockStyle}"
- Text="原料名称" />
- <Border
- Grid.ColumnSpan="2"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
-
- <!--<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="0,1,0,1" />
-
- </Grid>
- <!--#endregion-->
-
- <ScrollViewer
- Grid.Row="2"
- 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>
-
- <!--<TextBox
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- VerticalAlignment="Center"
- BorderBrush="#FF074B92"
- BorderThickness="1"
- FontFamily="楷体"
- FontSize="20"
- Foreground="#FF2AB2E7"
- Style="{StaticResource InputTextboxStyle}"
- Text="{Binding RawMaterialName}" />-->
-
- <TextBox
- Name="cb"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Height="{Binding ElementName=gr, Path=ActualHeight}"
- VerticalAlignment="Center"
- CaretBrush="DeepSkyBlue"
- FontSize="20"
- Foreground="#FF2AB2E7"
- 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"
- CaretBrush="DeepSkyBlue"
- 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>
-
- <Border
- Grid.Row="3"
- BorderBrush="#064d87"
- BorderThickness="0,1,0,0">
- <StackPanel
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
-
- <Button
- Width="80"
- Height="30"
- Command="{Binding SaveCommand}"
- Content="确认"
- Style="{StaticResource btn}" />
-
- <Button
- Name="btClose"
- Width="80"
- Height="30"
- Margin="7,0,0,0"
- Click="btClose_Click"
- Content="取消"
- Style="{StaticResource btn}" />
-
- </StackPanel>
- </Border>
-
-
- </Grid>
-
- </Grid>
- </Border>
- </Window>
|