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.

256 lines
19 KiB
XML

<UserControl x:Class="Aucma.Core.OldBoxFoam.Views.RoadKindPageView"
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:Aucma.Core.OldBoxFoam.Views"
mc:Ignorable="d" Background="#1152AC" FontFamily="Microsoft YaHei"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="20"/>
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<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="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="14"/>
<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="Gray" />
<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>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Background" Value="#0288d1" />
</Style>
</UserControl.Resources>
<Border >
<Grid>
<Border BorderBrush="#0288d1" BorderThickness="1" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<ItemsControl Grid.Column="0" ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" >
<ItemsControl.ItemsPanel>
<!--布局-->
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" VerticalAlignment="Top" ></WrapPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--控件模板-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Control x:Name="ctrl" Width="600" Height="200" VerticalAlignment="Top"></Control>
<DataTemplate.Triggers>
<!--根据不同类型选择不同模板-->
<DataTrigger Binding="{Binding Status}" Value ="1">
<!--矩形-->
<Setter Property="Template" TargetName="ctrl">
<Setter.Value>
<ControlTemplate >
<Border Margin="5,5" Background="#0288d1" BorderBrush="White" BorderThickness="2" >
<Grid Margin="3,3">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1">
<TextBlock Text="货道" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="箱体发泡名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock x:Name="spaceCodeText" Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>-->
</Grid>
</Border>
<Border Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<!--<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>-->
<!--<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>-->
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1" >
<TextBlock x:Name="spaceCodeText" Text="{Binding Local}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<TextBlock x:Name="ObjId" Text="{Binding ObjId}" FontSize="18" Foreground="Transparent" />
<Grid Grid.Column="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="4*"/>
<!--<ColumnDefinition Width="2*"/>-->
</Grid.ColumnDefinitions>
<!--<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
--><!--<RowDefinition/>--><!--
</Grid.RowDefinitions>-->
<Border Grid.Column="0" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<Button Command="{Binding DataContext.SubmitCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=ObjId}" Background="Transparent">
<TextBlock Text="{Binding MaterialName}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" />
</Button>
<!--<TextBlock x:Name="spaceCodeText2" Text="{Binding MaterialName}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>-->
</Border>
<!--<Border Grid.Column="2" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="清除" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>-->
<!--<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock x:Name="spaceCodeText5" Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock x:Name="spaceCodeText6" Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="清除" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>-->
<!--<Border Grid.Column="0" Grid.Row="2" BorderBrush="White" BorderThickness="1" >
<TextBlock x:Name="spaceCodeText7" Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="2" BorderBrush="White" BorderThickness="1" >
<TextBlock x:Name="spaceCodeText8" Text="{Binding MaterialCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2" Grid.Row="2" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="清除" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>-->
</Grid>
</Grid>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</Grid>
</Border>
</UserControl>