<Window x:Class="Khd.Core.Wpf.Form.CheShenChangDuGuanLi"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:hc="https://handyorg.github.io/handycontrol"
      xmlns:local="clr-namespace:Khd.Core.Wpf.Form"
      mc:Ignorable="d" 
      d:DesignHeight="600" d:DesignWidth="950" 
      Title="物料管理" Height="600" Width="950" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <hc:ThemeResources/>
                <hc:Theme/>
            </ResourceDictionary.MergedDictionaries>
            <!-- 控件样式代码-->
            <!--datagrid -->
            <Style x:Key="dgCell" TargetType="TextBlock">
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid>
                                <Border
                                    Name="Border"
                                    Background="#213269"
                                    BorderBrush="#172557"
                                    BorderThickness="3,0,20,3">
                                    <ContentPresenter
                                        x:Name="ContentSite"
                                        Margin="12,2,12,2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        ContentSource="Header" />
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter TargetName="Border" Property="Background" Value="#213269" />
                                </Trigger>
                                <Trigger Property="IsSelected" Value="False">
                                    <Setter TargetName="Border" Property="Background" Value="#213269" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="CustomButtonStyle" TargetType="{x:Type Button}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid>
                                <Border
                                    x:Name="border"
                                    Background="#213269"
                                    BorderBrush="#172557"
                                    BorderThickness="0,0,0,3" />
                                <ContentPresenter
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    RecognizesAccessKey="True"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <ColorAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                                    <EasingColorKeyFrame KeyTime="0" Value="#213269" />
                                                </ColorAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed" />
                                        <VisualState x:Name="Disabled" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsFocused" Value="True" />
                                <Trigger Property="IsDefaulted" Value="True" />
                                <Trigger Property="IsMouseOver" Value="True" />
                                <Trigger Property="IsPressed" Value="True" />
                                <Trigger Property="IsEnabled" Value="False" />
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <!--  TextBox默认样式  -->
            <Style x:Key="DefaultTextBox" TargetType="{x:Type TextBox}" />
            <Style x:Key="DefaultButton" TargetType="{x:Type Button}">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontFamily" Value="Microsoft YaHei" />
                <Setter Property="FontSize" Value="20" />

                <!--<Setter Property="FontWeight" Value="Bold"/>-->
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="30,30,30,30">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Offset="0.0" Color="#2c78fa" />
                                        <GradientStop Offset="0.2" Color="#2c78fa" />
                                        <GradientStop Offset="0.0" Color="#2c78fa" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="DefaultButtonSend" TargetType="{x:Type Button}">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontFamily" Value="Microsoft YaHei" />
                <Setter Property="FontSize" Value="20" />

                <!--<Setter Property="FontWeight" Value="Bold"/>-->
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="90,90,90,90">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Offset="0.0" Color="#2c78fa" />
                                        <GradientStop Offset="0.2" Color="#2c78fa" />
                                        <GradientStop Offset="0.0" Color="#2c78fa" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="EnableButtonSend" TargetType="{x:Type Button}">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontFamily" Value="Microsoft YaHei" />
                <Setter Property="FontSize" Value="20" />

                <!--<Setter Property="FontWeight" Value="Bold"/>-->
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="90,90,90,90">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Offset="0.0" Color="Gray" />
                                        <GradientStop Offset="0.2" Color="Gray" />
                                        <GradientStop Offset="0.0" Color="Gray" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <!-- 周义帆 20231008 一下代码添加-->
            <!-- 周义帆 20231008 一下代码添加-->
            <!--  清空按钮样式  -->
            <Style  x:Key="qingkongButton" TargetType ="{x:Type Button}" >
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="5">
                                <Border.Background>#1E90FF</Border.Background>
                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" ></ContentPresenter>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="White"></Setter>
                <Setter Property="FontSize" Value="14"></Setter>
            </Style>
            <!--  警告按钮样式  -->
            <Style  x:Key="jinggaoButton" TargetType ="{x:Type Button}" >
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="5">
                                <Border.Background>#EE0000</Border.Background>
                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" ></ContentPresenter>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="White"></Setter>
                <Setter Property="FontSize" Value="14"></Setter>
            </Style>
            <!--TextBox样式-->
            <Style x:Key="XingHaoBianMaYangShi" TargetType="{x:Type TextBox}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="TextBox">
                            <Border BorderThickness="1" BorderBrush="Gray" CornerRadius="8" Background="{TemplateBinding Background}">
                                <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"  BorderThickness="0" IsTabStop="False"></ScrollViewer>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
            </Style>
            <!--Plc信息TextBox样式-->
            <Style x:Key="tbxStyle" TargetType="{x:Type TextBox}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TextBox}">
                            <Grid>
                                <Border BorderThickness="2" BorderBrush="Gray" CornerRadius="4" Background="{TemplateBinding Background}">
                                    <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center" Background="{x:Null}" BorderThickness="0" IsTabStop="False"></ScrollViewer>
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <!--  查询按钮样式  -->
            <Style  x:Key="chaxunButton" TargetType ="{x:Type Button}" >
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="5">
                                <Border.Background>#66CD00</Border.Background>
                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" ></ContentPresenter>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="White"></Setter>
                <Setter Property="FontSize" Value="14"></Setter>
            </Style>
            <!--  修改按钮样式  -->
            <Style  x:Key="xiugaiButton" TargetType ="{x:Type Button}" >
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="5">
                                <Border.Background>#DAA520</Border.Background>
                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" ></ContentPresenter>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="White"></Setter>
                <Setter Property="FontSize" Value="14"></Setter>
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Background="#213269">
        <StackPanel>
           
            <StackPanel 
                Height="460" 
                Width="850"
                Margin="0,30,0,0"
                >
                <Grid  Height="100"  Margin="0,30"
                Width="840">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30*"/>
                        <ColumnDefinition Width="70*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Label Content="物料名称:" FontSize="35" HorizontalAlignment="Right" Background="Transparent" Foreground="White" BorderThickness="0"></Label>
                    </Grid>
                    <Grid Grid.Column="1">
                        <TextBox Margin="20,15" Name="marterName" Text="123456" FontSize="35"></TextBox>
                    </Grid>
                </Grid>
                <Grid  Height="100"  Margin="0,30"
                Width="840">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30*"/>
                        <ColumnDefinition Width="70*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Label Content="物料编码:" FontSize="35" HorizontalAlignment="Right" Background="Transparent" Foreground="White" BorderThickness="0"></Label>
                    </Grid>
                    <Grid Grid.Column="1">
                        <TextBox Margin="20,15" Text="123456" Name="marterCode" FontSize="35"></TextBox>
                    </Grid>
                </Grid>
                <Grid  Height="100" Margin="0,30"
                Width="840">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30*"/>
                        <ColumnDefinition Width="70*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Label Content="物料类型:" FontSize="35" HorizontalAlignment="Right" Background="Transparent" Foreground="White" BorderThickness="0"></Label>
                    </Grid>
                    <Grid Grid.Column="1">
                        <TextBox Margin="20,15" Text="123456" FontSize="35"></TextBox>
                        <ComboBox  Margin="20,15" FontSize="35" Name="marterType">
                            <ComboBoxItem Content="物料" />
                            <ComboBoxItem Content="成品" />
                        </ComboBox>
                    </Grid>
                </Grid>
            </StackPanel>
            <StackPanel
                 Orientation="Horizontal"
                Margin="0,20,0,0"
                Height="55" 
                Width="850">
                <Button Content="保  存" FontSize="25" Name="inster" Margin="200,0,150,0" Height="50" Width="100" Background="#3B56FD" Foreground="White"  Click="inster_Click"></Button>
                <Button Content="关  闭" FontSize="25" Name="close" Margin="130,0,300,0" Height="50" Width="100" Background="#3B56FD" Foreground="White" Click="cloce_Click" ></Button>
            </StackPanel>
        </StackPanel>
    </Grid>
</Window>
