fix(ui): add shared ComboBox templates and app styles

Shared app-level styles and ComboBox templates used across workflow views.
main
SYED MUSTUFA AHMED NAQVI 2026-08-27 10:02:01 +05:00
parent 7d0872b03b
commit 27327aa580
1 changed files with 34 additions and 4 deletions

View File

@ -1,8 +1,20 @@
<Application x:Class="HikvisionAttendanceManager.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:models="clr-namespace:HikvisionAttendanceManager.App.Models"
StartupUri="MainWindow.xaml">
<Application.Resources>
<!-- Implicit template for Device content presenters (e.g. non-ComboBox). -->
<DataTemplate DataType="{x:Type models:Device}">
<TextBlock Text="{Binding DisplayName}" TextTrimming="CharacterEllipsis" ToolTip="{Binding DisplayName}"/>
</DataTemplate>
<!-- Explicit template for device ComboBoxes: must set SelectionBoxItemTemplate too. -->
<DataTemplate x:Key="DeviceComboItemTemplate" DataType="{x:Type models:Device}">
<TextBlock Text="{Binding DisplayName}" TextTrimming="CharacterEllipsis" ToolTip="{Binding DisplayName}"/>
</DataTemplate>
<DataTemplate x:Key="LocationSiteComboItemTemplate" DataType="{x:Type models:LocationSite}">
<TextBlock Text="{Binding DisplayName}" TextTrimming="CharacterEllipsis" ToolTip="{Binding DisplayName}"/>
</DataTemplate>
<Color x:Key="Blue">#2563EB</Color>
<Color x:Key="BlueDark">#1D4ED8</Color>
<Color x:Key="Canvas">#F4F7FB</Color>
@ -23,7 +35,7 @@
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="7" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
@ -34,13 +46,31 @@
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}"/>
</Style>
<Style x:Key="HeaderRefreshButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Width" Value="112"/>
<Setter Property="MinWidth" Value="106"/>
<Setter Property="MaxWidth" Value="120"/>
<Setter Property="Height" Value="38"/>
<Setter Property="Padding" Value="14,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#1F2A44"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#D7E0EC"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
<Style x:Key="SidebarButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="Foreground" Value="#516079"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Height" Value="44"/>
<Setter Property="Padding" Value="20,0"/>
<Setter Property="Foreground" Value="#25324A"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="0,2"/>
<Setter Property="Margin" Value="0,4"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
</Style>
<Style x:Key="CardStyle" TargetType="Border">
<Setter Property="Background" Value="White"/>