mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 05:56:30 +00:00
d1af7958f8
day/winter/night switcher fixes
108 lines
4.7 KiB
XML
108 lines
4.7 KiB
XML
<UserControl x:Class="Azaion.Common.Controls.DetectionClasses"
|
|
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"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="300" d:DesignWidth="300">
|
|
<UserControl.Resources>
|
|
<Style x:Key="ButtonRadioButtonStyle" TargetType="RadioButton">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="RadioButton">
|
|
<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}"
|
|
Background="{TemplateBinding Background}" BorderThickness="1"
|
|
Padding="10,5" CornerRadius="2">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="Gray"/>
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="DarkGray"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="BorderBrush" Value="White"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid Background="Black">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<!-- Your DataGrid with detection classes -->
|
|
<DataGrid x:Name="DetectionDataGrid"
|
|
Grid.Row="0"
|
|
Background="Black"
|
|
RowBackground="#252525"
|
|
Foreground="White"
|
|
RowHeaderWidth="0"
|
|
Padding="2 0 0 0"
|
|
AutoGenerateColumns="False"
|
|
SelectionMode="Single"
|
|
CellStyle="{DynamicResource DataGridCellStyle1}"
|
|
IsReadOnly="True"
|
|
CanUserResizeRows="False"
|
|
CanUserResizeColumns="False"
|
|
SelectionChanged="DetectionDataGrid_SelectionChanged"
|
|
x:FieldModifier="public"
|
|
>
|
|
<DataGrid.Columns>
|
|
<DataGridTemplateColumn Width="50" Header="Клавіша" CanUserSort="False">
|
|
<DataGridTemplateColumn.HeaderStyle>
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<Setter Property="Background" Value="#252525"/>
|
|
</Style>
|
|
</DataGridTemplateColumn.HeaderStyle>
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Border Background="{Binding Path=ColorBrush}">
|
|
<TextBlock Text="{Binding Path=ClassNumber}"/>
|
|
</Border>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<DataGridTextColumn Width="*" Header="Назва" Binding="{Binding Path=Name}" CanUserSort="False">
|
|
<DataGridTextColumn.HeaderStyle>
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<Setter Property="Background" Value="#252525"/>
|
|
</Style>
|
|
</DataGridTextColumn.HeaderStyle>
|
|
</DataGridTextColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
<!-- StackPanel with mode switcher RadioButtons -->
|
|
<StackPanel x:Name="ModeSwitcherPanel"
|
|
Grid.Row="1"
|
|
Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,5,0,5">
|
|
<RadioButton x:Name="NormalModeRadioButton"
|
|
Tag="0"
|
|
Content="Звичайний"
|
|
GroupName="Mode"
|
|
Checked="ModeRadioButton_Checked"
|
|
IsChecked="True"
|
|
Style="{StaticResource ButtonRadioButtonStyle}"/>
|
|
<RadioButton x:Name="EveningModeRadioButton"
|
|
Tag="20"
|
|
Content="Зима"
|
|
GroupName="Mode"
|
|
Checked="ModeRadioButton_Checked" Margin="10,0,0,0"
|
|
Style="{StaticResource ButtonRadioButtonStyle}"/>
|
|
<RadioButton x:Name="NightModeRadioButton"
|
|
Tag="40"
|
|
Content="Ніч"
|
|
GroupName="Mode"
|
|
Checked="ModeRadioButton_Checked" Margin="10,0,0,0"
|
|
Style="{StaticResource ButtonRadioButtonStyle}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|