You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
8.2 KiB
XML

<Window x:Class="Aucma.Core.PalletizCX1.Views.SetRangeWindow"
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:Aucma.Core.PalletizCX1.Views"
xmlns:local1="clr-namespace:Aucma.Core.PalletizCX1.ConvertTo"
mc:Ignorable="d" FontFamily="Microsoft YaHei"
Title="设置转向角度" Height="700" Width="1800" >
<Window.Resources>
<local1:StringToIntConverter x:Key="StringToIntConverter"/>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="#dddddd"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Background="#1152AC" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Label Foreground="White" FontSize="20" Content="最小容积(包含)" HorizontalAlignment="Left" Margin="19,0,0,0" VerticalAlignment="Center"/>
<TextBox Foreground="White" FontSize="20" HorizontalAlignment="Left" Margin="179,0,0,0" TextWrapping="Wrap" Text="{Binding MinModel}" VerticalAlignment="Center" Width="120"/>
<Label Foreground="White" FontSize="20" Content="最大容积(不包含)" HorizontalAlignment="Left" Margin="354,0,0,0" VerticalAlignment="Center"/>
<TextBox Foreground="White" FontSize="20" HorizontalAlignment="Left" Margin="537,0,0,0" TextWrapping="Wrap" Text="{Binding MaxModel}" VerticalAlignment="Center" Width="120"/>
<Label Foreground="White" FontSize="20" Content="奇数货道旋转角度" HorizontalAlignment="Left" Margin="725,0,0,0" VerticalAlignment="Center"/>
<ComboBox x:Name="OddComboBox" SelectedItem="{Binding SelectedOddNumber, Mode=TwoWay, Converter={StaticResource StringToIntConverter}}" HorizontalAlignment="Left" Margin="915,34,0,0" VerticalAlignment="Top" Width="120" FontSize="25" Foreground="White">
<ComboBoxItem Content="0" Foreground="Blue"/>
<ComboBoxItem Content="90" Foreground="Blue"/>
<ComboBoxItem Content="180" Foreground="Blue" />
<ComboBoxItem Content="270" Foreground="Blue"/>
</ComboBox>
<Label Foreground="White" FontSize="20" Content="偶数货道旋转角度" HorizontalAlignment="Left" Margin="1089,0,0,0" VerticalAlignment="Center"/>
<ComboBox x:Name="EvenComboBox" SelectedItem="{Binding SelectedEvenNumber, Mode=TwoWay, Converter={StaticResource StringToIntConverter}}" HorizontalAlignment="Left" Margin="1298,0,0,0" Width="120" FontSize="25" Foreground="White">
<ComboBoxItem Content="0" Foreground="Blue"/>
<ComboBoxItem Content="90" Foreground="Blue"/>
<ComboBoxItem Content="180" Foreground="Blue" />
<ComboBoxItem Content="270" Foreground="Blue"/>
</ComboBox>
<Button Content="添加规则" Command="{Binding SaveCommand}" FontSize="22" HorizontalAlignment="Left" Margin="1512,24,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.106,0.524" Width="134" Height="55"/>
</Grid>
<Grid Grid.Row="1" >
<Label Content="规则列表" FontSize="25" Foreground="White" Margin="88,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
<!--<Button Content="外侧提升机" Click="LeftButton_Click" Height="70" Background="Green" Width="130" Margin="49,107,221,88" />
<Button Content="内侧提升机" Click="RightButton_Click" Height="70" Background="Green" Width="130" Margin="220,107,50,88" />-->
<DataGrid Grid.Row="2" ItemsSource="{Binding ListItems}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ObjId}" Header="序号" Width="*" FontSize="20" />
<DataGridTextColumn Binding="{Binding MinModel}" Header="最小容积(包含)" Width="2*" FontSize="20" />
<DataGridTextColumn Binding="{Binding MaxModel}" Header="最大容积(不包含)" Width="2*" FontSize="20" />
<DataGridTextColumn Binding="{Binding OddSpaceRange}" Header="奇数货道旋转角度" Width="2*" FontSize="20" />
<DataGridTextColumn Binding="{Binding EvenSpaceRange}" Header="偶数货道旋转角度" Width="2*" FontSize="20"/>
<DataGridTemplateColumn Header="操作" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Content="删除" CommandParameter="{Binding ObjId}" Background="Red" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="Red" BorderThickness="1" Width="80" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>