|
|
|
|
<UserControl x:Class="Audit.View.StuffView"
|
|
|
|
|
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:local="clr-namespace:Audit.View"
|
|
|
|
|
mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Stuff}"
|
|
|
|
|
d:DesignHeight="900" d:DesignWidth="1140"
|
|
|
|
|
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
<Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.ThemeBackground}"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="#FFF0F0F0"/>
|
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}"/>
|
|
|
|
|
<Setter Property="FontFamily" Value="{DynamicResource MahApps.Fonts.Family.Control}"/>
|
|
|
|
|
<Setter Property="FontSize" Value="{DynamicResource MahApps.Font.Size.Content}"/>
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Text}"/>
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
|
|
|
|
<Setter Property="Padding" Value="6 0 0 0"/>
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
|
|
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type RadioButton}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Border x:Name="border" Background="{TemplateBinding Background}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition>
|
|
|
|
|
</ColumnDefinition>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="1"
|
|
|
|
|
Text="{TemplateBinding Content}"
|
|
|
|
|
FontFamily="Fonts/#FontAwesome"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
Width="80" FontSize="20" Margin="0,5,0,0"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#FFA0A0A0" TargetName="border"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#FFF5F5F5" TargetName="border"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="30"/>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border BorderThickness="0,0,0,1" BorderBrush="#CCCCCC">
|
|
|
|
|
</Border>
|
|
|
|
|
<Grid Grid.Row="0"/>
|
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
|
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" ItemsSource="{Binding Product}" SelectionMode="Single" AlternationCount="2" IsReadOnly="True" HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC" BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" VerticalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled" Grid.ColumnSpan="2">
|
|
|
|
|
<DataGrid.RowStyle >
|
|
|
|
|
<Style TargetType="{x:Type DataGridRow}">
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
|
|
|
<Setter Property="Background" Value="#FFFFFFFF" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
|
|
|
<Setter Property="Background" Value="#FFF5F5F5" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="False">
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.RowStyle>
|
|
|
|
|
<DataGrid.CellStyle>
|
|
|
|
|
<Style TargetType="DataGridCell">
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="MinWidth" Value="20"/>
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="False">
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.CellStyle>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<DataGridTextColumn Header="序号" Width="50" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="原料代码" Width="130" FontSize="15" Binding="{Binding ProductCode}" MaxWidth="200" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" Binding="{Binding ProductName}" MaxWidth="300" MinWidth="200" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="价格" Width="100" FontSize="15" Binding="{Binding Price}" MaxWidth="200" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="供应商" Width="150" FontSize="15" Binding="{Binding ProductUnit}" MaxWidth="250" MinWidth="150" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" Binding="{Binding ProductType}" MaxWidth="200" MinWidth="70" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="色彩" Width="100" FontSize="15" Binding="{Binding Color}" MaxWidth="500" MinWidth="50" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="浓度" Width="70" FontSize="15" Binding="{Binding Concentration}" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="比重" Width="70" FontSize="15" Binding="{Binding GRAVITY}" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
<RadioButton Content="染料" HorizontalAlignment="Left" Height="40" Margin="995,265,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/>
|
|
|
|
|
<RadioButton Content="助剂" HorizontalAlignment="Left" Height="40" Margin="995,305,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/>
|
|
|
|
|
<RadioButton Content="粉体助剂" HorizontalAlignment="Left" Height="40" Margin="995,345,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/>
|
|
|
|
|
<RadioButton Content="全部原料" HorizontalAlignment="Left" Height="40" Margin="995,385,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/>
|
|
|
|
|
<TextBox x:Name="stuff_ProductCode" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text="" VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" Grid.ColumnSpan="2"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="原料代码" VerticalAlignment="Bottom" Width="100" FontSize="20"/>
|
|
|
|
|
<TextBox x:Name="stuff_ProductName" HorizontalAlignment="Left" Height="30" Margin="345,0,0,100" Text="" VerticalAlignment="Bottom" Width="200" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" TextWrapping="Wrap" Text="原料名称" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<ComboBox x:Name="stuff_ProductType" HorizontalAlignment="Left" Height="30" Margin="645,0,0,100" Text="" VerticalAlignment="Bottom" Width="100" FontSize="16" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="原料类型" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<TextBox x:Name="stuff_Color" HorizontalAlignment="Left" Height="30" Margin="465,0,0,50" Text="" VerticalAlignment="Bottom" Width="60" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="420,0,0,50" TextWrapping="Wrap" Text="色彩" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<TextBox x:Name="stuff_ProductUnit" HorizontalAlignment="Left" Height="30" Margin="105,0,0,50" Text="" VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" Grid.ColumnSpan="2"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="供应商" VerticalAlignment="Bottom" Width="100" FontSize="20"/>
|
|
|
|
|
<TextBox x:Name="stuff_Price" HorizontalAlignment="Left" Height="30" Margin="305,0,0,50" Text="" VerticalAlignment="Bottom" Width="100" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,50" TextWrapping="Wrap" Text="价格" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<TextBox x:Name="stuff_Concentration" HorizontalAlignment="Left" Height="30" Margin="585,0,0,50" Text="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="540,0,0,50" TextWrapping="Wrap" Text="浓度" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<TextBox x:Name="stuff_GRAVITY" HorizontalAlignment="Left" Height="30" Margin="695,0,0,50" Text="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="650,0,0,50" TextWrapping="Wrap" Text="比重" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
|
|
|
|
|
<Button Content="存储" HorizontalAlignment="Left" Height="65" Margin="795,0,0,60" VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" Click="Button_Preservation"/>
|
|
|
|
|
<Button Content="删除" HorizontalAlignment="Left" Height="65" Margin="975,0,0,60" VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" Click="Button_Delete"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|