|
- <Window x:Class="FryPot_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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:FryPot_DosingSystem.View"
- xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
- mc:Ignorable="d"
- Title="NewRecipeView" Height="550" Width="800"
- WindowStyle="None" WindowStartupLocation="CenterScreen" AllowsTransparency="True">
- <Window.DataContext>
- <vm:NewRecipeViewModel></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>
- <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
- <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
- <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
- <Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
- <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
- <Setter Property="HorizontalContentAlignment" Value="Left"/>
- <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
- <Setter Property="AllowDrop" Value="true"/>
- <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
- <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TextBox}">
- <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
- <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Opacity" TargetName="border" Value="0.56"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
- <Condition Property="IsSelectionActive" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
- </MultiTrigger>
- </Style.Triggers>
- </Style>
- <SolidColorBrush x:Key="foreground" Color="#a2c2e8"/>
- <SolidColorBrush x:Key="borderBrush" Color="Aqua"/>
- <Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
- <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
- <Setter Property="Foreground" Value="{DynamicResource foreground}"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderBrush" Value="{DynamicResource borderBrush}"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="Margin" Value="0,0,0,0"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="Height" Value="24"/>
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
- <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
- <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
- <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="IsTextSearchCaseSensitive" Value="true"/>
- <Setter Property="IsEditable" Value="true"/>
- <Setter Property="StaysOpenOnEdit" Value="true"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
- <Grid>
- <Themes1:ClassicBorderDecorator x:Name="Border" BorderStyle="None" BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}" BorderThickness="2">
- <Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="False" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
- <Themes1:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=Border}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
- <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
- <Border.Background>
- <SolidColorBrush Color="#264c73"></SolidColorBrush>
- </Border.Background>
- <ScrollViewer x:Name="DropDownScrollViewer">
- <Grid RenderOptions.ClearTypeHint="Enabled">
- <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
- <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
- </Canvas>
- <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- </Grid>
- </ScrollViewer>
- </Border>
- </Themes1:SystemDropShadowChrome>
- </Popup>
- </Themes1:ClassicBorderDecorator>
- <DockPanel Margin="2">
- <FrameworkElement DockPanel.Dock="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
- <Border x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}">
- <ContentPresenter ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,1,1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Border>
- </DockPanel>
- <ToggleButton ClickMode="Press" Focusable="false" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="2" MinWidth="0" MinHeight="0" Style="{StaticResource ComboBoxTransparentButtonStyle}" Width="Auto"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsDropDownOpen" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
- </MultiTrigger>
- <Trigger Property="HasItems" Value="false">
- <Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsGrouping" Value="true"/>
- <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
- </MultiTrigger>
- <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
- <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
- <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
- </Trigger>
- <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
- <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
- <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsEditable" Value="true">
- <Setter Property="IsTabStop" Value="false"/>
- <Setter Property="Padding" Value="1"/>
- <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
- </Window.Resources>
- <Border Name="br">
- <Border.Background>
- <!--<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png"></ImageBrush>-->
- <SolidColorBrush Color="#264c73">
-
- </SolidColorBrush>
- </Border.Background>
- <Grid >
- <Grid.RowDefinitions>
- <RowDefinition Height="50"></RowDefinition>
- <RowDefinition Height="80"></RowDefinition>
- <RowDefinition Height="40"></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
-
- <TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="0,10"></TextBlock>
- <UniformGrid Grid.Row="1" Columns="2">
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal" Margin="0,8">
- <TextBlock Text="请输入配方名称:" Foreground="#FF2AB2E7" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
- <TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeName}" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange"
- VerticalContentAlignment="Center"
- BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" ></TextBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="请输入桶的数量:" Foreground="#FF2AB2E7" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
- <TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeRollerNum}" InputMethod.IsInputMethodEnabled="False" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange"
- VerticalContentAlignment="Center"
- BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" TextChanged="TextBox_TextChanged"></TextBox>
- </StackPanel>
- </StackPanel>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
- <Button Content="添加原料" Width="180" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" Command="{Binding AddRecipe}" ></Button>
- <Button Content="确认更新" Height="30" Width="180" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding Comfirm}"></Button>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
- <Button Content="另存为" Height="30" Width="180" Margin="0,0,10,0" Command="{Binding SaveAs}" Cursor="Hand"/>
- <Button Click="Button_Click" Content="取消" Height="30" FontSize="20" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Width="180" Cursor="Hand"></Button>
- </StackPanel>
- </Grid>
-
- </UniformGrid>
- <Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="210"/>
- <ColumnDefinition Width="225"/>
- <ColumnDefinition Width="225"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
- <GridSplitter></GridSplitter>
- <TextBlock Grid.Column="1" Text="原料桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
- <GridSplitter Grid.Column="1"></GridSplitter>
- <TextBlock Grid.Column="2" Text="原料重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"></TextBlock>
- <GridSplitter Grid.Column="2"></GridSplitter>
- <TextBlock Grid.Column="3" Text="操作" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
- </Grid>
- <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding materials}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel></StackPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton>
- <RadioButton.Template>
- <ControlTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="210"/>
-
- <ColumnDefinition Width="210"></ColumnDefinition>
- <ColumnDefinition Width="225"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <ComboBox ItemsSource="{Binding DataContext.materialNames,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" Text="{Binding MaterialName}" Margin="10,0,0,10" Width="190" FontSize="14" KeyUp="ComboBox_KeyUp" LostFocus="ComboBox_LostFocus" Style="{StaticResource ComboBoxStyle1}">
- <ComboBox.ItemContainerStyle>
- <Style TargetType="{x:Type ComboBoxItem}">
- <Setter Property="Background" Value="White" />
- <Setter Property="Foreground" Value="#e69519"/>
-
-
- </Style>
- </ComboBox.ItemContainerStyle>
- </ComboBox>
- <StackPanel Grid.Column="1" Orientation="Horizontal" >
- <TextBox Text="{Binding MaterialLoc}" Background="Transparent" FontSize="14"
- BorderBrush="#e69519" Foreground="LightGray" Width="170" Margin="35,0,0,10" ></TextBox>
-
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Column="2">
- <TextBox Text="{Binding MaterialWeight}" Background="Transparent" FontSize="14"
- BorderBrush="#e69519" Foreground="LightGray" Width="170" Margin="35,0,0,10" ></TextBox>
- <TextBlock VerticalAlignment="Center" Margin="4,0,0,10" Text="g" Foreground="#e69519" ></TextBlock>
- </StackPanel>
- <Button Grid.Column="3"
- Content="删除"
- Width="94"
- FontSize="14"
- Margin="0,0,20,10"
- Background="Transparent"
- BorderBrush="#e69519" Foreground="LightGray" HorizontalAlignment="Right"
- Command="{Binding DataContext.RemoveRecipe,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
- CommandParameter="{Binding MaterialCode}"></Button>
- </Grid>
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Border>
- </Window>
|