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.

385 lines
25 KiB
XML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<Window x:Class="XGL.Views.FormClassesTime"
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:convert="clr-namespace:XGL.Tools"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:localDate="clr-namespace:XGL.Tools"
Height="400" Width="380"
Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Window.Resources>
<ResourceDictionary>
<Style x:Key="RoundButton" TargetType="Button">
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Ellipse
Name="GelBackground"
Stroke="Black"
StrokeThickness="1" >
<Ellipse.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF34268A" Offset="0.1"></GradientStop>
<GradientStop Color="#FF33288B" Offset="0.5"></GradientStop>
<GradientStop Color="#FF2281D1" Offset="0.9"></GradientStop>
</LinearGradientBrush>
</Ellipse.Fill>
</Ellipse>
<ContentPresenter
Name="GelButtonContent"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CustomButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Height" Value="40"></Setter>
<Setter Property="Width" Value="100"></Setter>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="FontSize" Value="18"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Border
x:Name="border"
Background="#2F82E7"
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>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="TextBlock.FontSize" Value="22" />
<Setter Property="BorderThickness" Value="0 0 1 1" />
<Setter Property="BorderBrush" Value="LightGray" />
</Style>
<convert:MyValueConverter x:Key="MyConverter"/>
<convert:SyncFlagConverter x:Key="SyncFlagConverter"/>
<convert:SyncFlagColorConverter x:Key="SyncFlagColorConvert"/>
<!--日历样式-->
<Style TargetType="CalendarDayButton" x:Key="CalendarDayBtnStyle">
<Setter Property="FontSize" Value="18"></Setter>
</Style>
<Style x:Key="calendarWithGotToTodayStyle"
TargetType="{x:Type Calendar}">
<Setter Property="CalendarDayButtonStyle"
Value="{StaticResource CalendarDayBtnStyle}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Calendar}">
<Border>
<StackPanel Orientation="Vertical">
<StackPanel x:Name="PART_Root"
HorizontalAlignment="Center" Background="#FF878787">
<CalendarItem x:Name="PART_CalendarItem"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Style="{TemplateBinding CalendarItemStyle}"
Height="{TemplateBinding Height}"
/>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="52"></ColumnDefinition>
<ColumnDefinition Width="26"></ColumnDefinition>
<ColumnDefinition Width="52"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="PART_GoToday"
Width="40" Height="20"
Text="今天" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
<TextBlock Grid.Column="2" x:Name="PART_GoClear"
Width="40" Height="20"
Text="清空" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
</Grid>
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--ComboBox下拉按钮-->
<Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="Back" Background="#F7FDF7" BorderThickness="1" BorderBrush="Transparent">
<Path Name="PathFill" Fill="Blue" Width="8" Height="4" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" >
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox" x:Key="ComboBoxStyle">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<!--ComBoxItem #59CA4F #81D779-->
<Style TargetType="ComboBoxItem">
<Setter Property="Height" Value="60"></Setter>
<Setter Property="MinHeight" Value="22"></Setter>
<Setter Property="MinWidth" Value="60"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border Name="Back" Background="Transparent" CornerRadius="5,5,5,5"
RenderTransformOrigin="0.5,0.5" BorderThickness="0,0,0,0" BorderBrush="Blue" >
<ContentPresenter ContentSource="{Binding Source}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid Background="#F7FDF7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.3*" MaxWidth="30"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="PART_EditableTextBox" Grid.Column="0" IsReadOnly="{TemplateBinding IsReadOnly}" FontSize="18" VerticalContentAlignment="Center" Text="{TemplateBinding Text}"></TextBox>
<Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="LightGray" CornerRadius="1,0,0,1">
</Border>
<Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="LightGray" CornerRadius="0,1,1,0">
<ToggleButton Style="{StaticResource ComboxStyleBtn}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
</Border>
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
<Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
</Border.Effect>
<ScrollViewer Margin="4,6,4,6" Style="{DynamicResource ScrollViewerStyle}" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="Width" Value="120"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Border BorderBrush="Gray" BorderThickness="1" CornerRadius="5" Background="White">
<Grid>
<!--下拉箭头-->
<ToggleButton ClickMode="Press" Focusable="False" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="2" MinWidth="0" MinHeight="0" Width="Auto">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#00000000"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<DockPanel Background="{TemplateBinding Background}" LastChildFill="False" SnapsToDevicePixels="True">
<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" DockPanel.Dock="Right" >
<Path Data="M0,0L3.5,4 7,0z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
<!--项内容-->
<ContentPresenter IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" VerticalAlignment="Center" Margin="3" />
<!--下拉显示面板HorizontalOffset:设置下拉面板的相对位置-->
<Popup HorizontalOffset="-1" Width="{TemplateBinding ActualWidth}"
IsOpen="{TemplateBinding IsDropDownOpen}" Focusable="False" PopupAnimation="Slide">
<Grid SnapsToDevicePixels="True" HorizontalAlignment="Stretch">
<Border BorderThickness="1,1,1,1" BorderBrush="Gray" CornerRadius="5">
<Border.Background>
<SolidColorBrush Color="White" />
</Border.Background>
</Border>
<ScrollViewer SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Hidden" >
<StackPanel IsItemsHost="True"/>
</ScrollViewer>
</Grid>
</Popup>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid Background="White" Margin="10">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Grid.RowSpan="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="30" />
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="6" Header="白班" >
</GroupBox>
<Label Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30">开始时间</Label>
<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cbxhour" Height="30" Width="100" />
<ComboBox Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" x:Name="cbxmin" Height="30" Width="100" />
<Label Grid.Row="0" Grid.Column="3" HorizontalAlignment="Center" Height="30" ></Label>
<Label Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" >结束时间</Label>
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cbxhour1" Height="30" Width="100" />
<ComboBox Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" x:Name="cbxmin1" Height="30" Width="100" />
<Label Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" Height="30" ></Label>
</Grid>
<!--<TextBox Grid.Row="0" x:Name="txtBarcode" FontSize="18" Width="80" Height="30" VerticalContentAlignment="Center" TextChanged="txtBarcode_TextChanged" Margin="87,27,233,23"/>-->
<Grid Grid.Row="2" Grid.RowSpan="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="30"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="6" Header="夜班" >
</GroupBox>
<Label Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30">开始时间</Label>
<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cbxhour2" Height="30" Width="100" />
<ComboBox Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="112" x:Name="cbxmin2" Height="30" Width="100" />
<Label Grid.Row="0" Grid.Column="3" HorizontalAlignment="Center" Height="30" ></Label>
<Label Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" >结束时间</Label>
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cbxhour3" Height="30" Width="100" />
<ComboBox Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" x:Name="cbxmin3" Height="30" Width="100" />
<Label Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" Height="30" ></Label>
</Grid>
<StackPanel Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button
x:Name="btnOK"
Width="100"
Height="40"
Margin="60,0,0,0"
Background="#2F82E7"
Content="确定"
FontSize="20"
Foreground="White"
IsCancel="True" Click="btnOK_Click" />
<Button
x:Name="btnCancel"
Width="100"
Height="40"
Margin="60,0,0,0"
Background="#2F82E7"
Content="取消"
FontSize="20"
Foreground="White"
IsCancel="True" Click="btnCancel_Click"/>
</StackPanel>
</Grid>
</Window>