PIbd-42_Kashin_M.I_CPO_Cour.../EmployeeManagmentView/App.xaml

185 lines
10 KiB
XML

<Application x:Class="EmployeeManagmentView.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<!-- Стиль для закругленных кнопок -->
<Style x:Key="RoundedButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Border Background="{TemplateBinding Background}"
CornerRadius="15"
BorderBrush="Transparent"
BorderThickness="0"
x:Name="ButtonBorder">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="10" ShadowDepth="2" Opacity="0.4" />
</Border.Effect>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<Grid.RenderTransform>
<ScaleTransform x:Name="scaleTransform" ScaleX="1" ScaleY="1" />
</Grid.RenderTransform>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="ButtonBorder"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="#0066CC" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="ButtonBorder"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="#004890" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
<Setter Property="RenderTransform" TargetName="ButtonBorder">
<Setter.Value>
<ScaleTransform ScaleX="0.95" ScaleY="0.95" />
</Setter.Value>
</Setter>
<Setter TargetName="ButtonBorder" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Black" BlurRadius="15" ShadowDepth="0" Opacity="0.6" />
</Setter.Value>
</Setter>
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleX"
To="0.95" Duration="0:0:0.2" />
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleY"
To="0.95" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleX"
To="1.0" Duration="0:0:0.2" />
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleY"
To="1.0" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Стиль для закругленного TextBox -->
<Style x:Key="RoundedTextBoxStyle" TargetType="TextBox">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Background="White"
CornerRadius="15"
BorderBrush="Black">
<ScrollViewer Margin="5" x:Name="PART_ContentHost"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<!-- Подсветка рамки при фокусе -->
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="#004890"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Стиль для DataGrid -->
<Style x:Key="RoundedDataGridStyle" TargetType="DataGrid">
<Setter Property="Background" Value="#FFFFFF"/>
<Setter Property="Foreground" Value="#000000"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="AlternatingRowBackground" Value="#FFFFFF"/>
<Setter Property="RowHeight" Value="30"/>
<Style.Triggers>
<!-- Эффект при наведении на строку -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFFFFF"/>
</Trigger>
</Style.Triggers>
<Style.Resources>
<!-- Стиль для ячеек DataGrid -->
<Style TargetType="DataGridCell">
<Setter Property="Padding" Value="10"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#004890"/>
<Setter Property="Foreground" Value="#FFFFFF"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Стиль для строк -->
<Style TargetType="DataGridRow">
<Setter Property="Padding" Value="5"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#0D2D4F"/>
<Setter Property="Foreground" Value="#FFFFFF"/>
</Trigger>
<!-- Стиль для выделенной строки (не должна быть белой) -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#0D2D4F"/>
<!-- Цвет фона выделенной строки -->
<Setter Property="Foreground" Value="#FFFFFF"/>
<!-- Цвет текста в выделенной строке -->
</Trigger>
</Style.Triggers>
</Style>
<!-- Стиль для шапки DataGrid -->
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#0D2D4F"/>
<Setter Property="Foreground" Value="#FFFFFF"/>
<Setter Property="Height" Value="40"/>
<!-- Увеличение высоты шапки -->
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="10"/>
</Style>
</Style.Resources>
</Style>
</Application.Resources>
</Application>