You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
10 KiB
176 lines
10 KiB
<UserControl x:Class="SchedulingSystemClient.YWRYPBWindow" |
|
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:SchedulingSystemClient" |
|
mc:Ignorable="d" |
|
d:DesignHeight="450" d:DesignWidth="800"> |
|
<UserControl.Resources> |
|
<ControlTemplate x:Key="ExampleButton" TargetType="{x:Type Button}"> |
|
<Border Background="White" BorderThickness="0" x:Name="Border" Padding="10" Margin="5,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"> |
|
<ContentPresenter /> |
|
</Border> |
|
<ControlTemplate.Triggers> |
|
<Trigger Property="IsEnabled" Value="False"> |
|
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,2"/> |
|
<Setter TargetName="Border" Property="BorderBrush" Value="#315DDA"/> |
|
<Setter TargetName="Border" Property="TextBlock.Foreground" Value="#315DDA"/> |
|
</Trigger> |
|
</ControlTemplate.Triggers> |
|
</ControlTemplate> |
|
<Style x:Key="header" TargetType="DataGridColumnHeader"> |
|
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter> |
|
<Setter Property="Foreground" Value="#484848"></Setter> |
|
<Setter Property="Background" Value="#E8E8E8"></Setter> |
|
<Setter Property="BorderBrush" Value="#DDDDDD"></Setter> |
|
<Setter Property="BorderThickness" Value="1"></Setter> |
|
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter> |
|
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> |
|
<Setter Property="FontSize" Value="20"></Setter> |
|
<!--<Setter Property="Height" Value="40"></Setter>--> |
|
<Setter Property="Padding" Value="15,10"></Setter> |
|
</Style> |
|
<Style x:Key="cell" TargetType="TextBlock"> |
|
<Setter Property="HorizontalAlignment" Value="Center"></Setter> |
|
<Setter Property="Padding" Value="20,15"></Setter> |
|
<Setter Property="Foreground" Value="#484848"></Setter> |
|
<Setter Property="FontSize" Value="16"></Setter> |
|
</Style> |
|
<Style x:Key="row" TargetType= "{x:Type DataGridRow}"> |
|
<Setter Property="BorderBrush" Value="#ECEEF4"></Setter> |
|
<Style.Triggers> |
|
<!--单行颜色--> |
|
<Trigger Property= "ItemsControl.AlternationIndex" |
|
Value= "0" > |
|
<Setter Property= "Background" Value= "#FFFFFF" /> |
|
</Trigger> |
|
<!--双行颜色--> |
|
<Trigger Property= "ItemsControl.AlternationIndex" |
|
Value= "1" > |
|
<Setter Property= "Background" Value= "#FFFFFF" /> |
|
</Trigger> |
|
<!--鼠标移入行颜色--> |
|
<Trigger Property="IsMouseOver" Value="True"> |
|
<Setter Property="Background" Value="#EDF0FA"/> |
|
</Trigger> |
|
</Style.Triggers> |
|
</Style> |
|
<!--选中行颜色--> |
|
<Style x:Key="dgc" TargetType="DataGridCell"> |
|
<Setter Property="BorderBrush" Value="#ECEEF4"></Setter> |
|
<Style.Triggers> |
|
<Trigger Property="IsSelected" Value="True"> |
|
<Setter Property="Background" Value="#EDF0FA"/> |
|
<Setter Property="BorderBrush" Value="#0000"/> |
|
</Trigger> |
|
</Style.Triggers> |
|
</Style> |
|
<Style x:Key="Dgrid" TargetType="DataGrid"> |
|
<!--内容边框颜色--> |
|
<Setter Property="HorizontalGridLinesBrush" Value="#ECEEF4"></Setter> |
|
<Setter Property="VerticalGridLinesBrush" Value="#ECEEF4"></Setter> |
|
<!--获取或设置一个值,该值指示是否自动创建列--> |
|
<Setter Property="AutoGenerateColumns" Value="False"/> |
|
<!--获取或设置一个值,该值指示用户是否可使用鼠标调整列宽--> |
|
<Setter Property="CanUserResizeColumns" Value="False"/> |
|
<!--获取或设置一个值,该值指示用户能否通过用鼠标拖动列标题来更改列的显示顺序--> |
|
<Setter Property="CanUserReorderColumns" Value="False"/> |
|
<!--获取或设置一个值,该值指示用户是否可在 DataGrid 中添加新行--> |
|
<Setter Property="CanUserAddRows" Value="False"/> |
|
<!--获取或设置一个值,该值指示用户是否可从 DataGrid 中删除行--> |
|
<Setter Property="CanUserDeleteRows" Value="False"/> |
|
<Setter Property="IsReadOnly" Value="True"/> |
|
<!--列表前面空白列--> |
|
<Setter Property="RowHeaderWidth" Value="0"/> |
|
</Style> |
|
<!--下拉框--> |
|
<ControlTemplate x:Key="CusComboBox" TargetType="{x:Type ComboBox}" > |
|
<Border BorderThickness="2" BorderBrush="#E4E4E4"> |
|
<Grid> |
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition Width="9*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
</Grid.ColumnDefinitions> |
|
<!--文本框--> |
|
<TextBox x:Name="myTxt" Grid.Column="0" |
|
Text="{TemplateBinding Text}" |
|
Background="White" |
|
BorderThickness="0" |
|
VerticalContentAlignment="Center" |
|
HorizontalContentAlignment="Center" |
|
FontSize="18" |
|
Foreground="Black"/> |
|
<!--下拉按钮--> |
|
<ToggleButton Grid.Column="1" Content="∨" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
|
ClickMode="Press" Background="White" BorderThickness="0"/> |
|
<Popup Name="MyPopup" |
|
IsOpen="{TemplateBinding IsDropDownOpen}" |
|
Placement="Bottom"> |
|
<Border MinWidth="{TemplateBinding ActualWidth}" |
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"> |
|
<ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}" |
|
HorizontalScrollBarVisibility="Auto" |
|
VerticalScrollBarVisibility="Auto"> |
|
<StackPanel Background="White" |
|
IsItemsHost="True"/> |
|
</ScrollViewer> |
|
</Border> |
|
</Popup> |
|
</Grid> |
|
</Border> |
|
</ControlTemplate> |
|
<!--占位符--> |
|
<Style x:Key="placeHolder" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}"> |
|
<Setter Property="Template"> |
|
<Setter.Value> |
|
<ControlTemplate TargetType="{x:Type TextBox}"> |
|
<Grid> |
|
<TextBox Padding="0,0,0,0" VerticalContentAlignment="Center" Text="{Binding Path=Text, |
|
RelativeSource={RelativeSource TemplatedParent}, |
|
Mode=TwoWay, |
|
UpdateSourceTrigger=PropertyChanged}" |
|
x:Name="textSource" |
|
Background="Transparent" |
|
Panel.ZIndex="2" /> |
|
<TextBox Padding="0,0,0,0" VerticalContentAlignment="Center" Text="{TemplateBinding Tag}" Background="{TemplateBinding Background}" Panel.ZIndex="1"> |
|
<TextBox.Style> |
|
<Style TargetType="{x:Type TextBox}"> |
|
<Setter Property="Foreground" Value="Transparent"/> |
|
<Style.Triggers> |
|
<DataTrigger Binding="{Binding Path=Text, Source={x:Reference textSource}}" Value=""> |
|
<Setter Property="Foreground" Value="#aaaaaa"/> |
|
</DataTrigger> |
|
</Style.Triggers> |
|
</Style> |
|
</TextBox.Style> |
|
</TextBox> |
|
</Grid> |
|
</ControlTemplate> |
|
</Setter.Value> |
|
</Setter> |
|
</Style> |
|
</UserControl.Resources> |
|
<Grid> |
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="1*"></RowDefinition> |
|
<RowDefinition Height="10*"></RowDefinition> |
|
</Grid.RowDefinitions> |
|
<DockPanel LastChildFill="False" Background="White"> |
|
<Button x:Name="SSYS" FontSize="18" Click="SSYS_Click" Template="{StaticResource ExampleButton}" Content="手术医生"></Button> |
|
<Button x:Name="MZYS" FontSize="18" Click="MZYS_Click" Template="{StaticResource ExampleButton}" Content="麻醉医生"></Button> |
|
<Button x:Name="HS" FontSize="18" Click="HS_Click" Template="{StaticResource ExampleButton}" Content="护士"></Button> |
|
</DockPanel> |
|
<Grid Grid.Row="1"> |
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
<ColumnDefinition Width="1*"></ColumnDefinition> |
|
</Grid.ColumnDefinitions> |
|
</Grid> |
|
</Grid> |
|
</UserControl>
|
|
|