IntuneManagement 4.0.0-beta1

This commit is contained in:
Mikael Karlsson
2026-09-23 19:13:09 +10:00
commit 7869619510
892 changed files with 577109 additions and 0 deletions
+166
View File
@@ -0,0 +1,166 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Theme brushes — a single file, two variants, automatic selection.
Avalonia walks ResourceDictionary.ThemeDictionaries based on the active
Application.RequestedThemeVariant (set by AvaloniaHost.Initialize via
the ThemeVariant setting / IM_THEME_VARIANT env var). This is the
idiomatic replacement for the WPF "load Default.xaml or Dark.xaml"
pattern: same key, different value per variant, no per-load swap.
-->
<ResourceDictionary.ThemeDictionaries>
<!--
Light palette, refreshed 2026-08-23 to sit closer to Windows 11.
Keep in step with UI/WPF/Themes/Light.xaml - the two backends are meant
to look the same, and that file carries the same reasoning.
Headline change is TitleBackgroundColor: it was #FF9B9B9B, a heavy
mid-grey that read as a Windows 7 toolbar. It cannot simply go white,
though - it backs the title strips, which must stay distinct from the
window - so it becomes a light grey rather than disappearing.
-->
<ResourceDictionary x:Key="Light">
<!-- Title strips. Dark text sits on this, so it stays well above mid-grey. -->
<SolidColorBrush x:Key="TitleBackgroundColor" Color="#FFECECEC"/>
<SolidColorBrush x:Key="TitleForegroundColor" Color="#FF1A1A1A"/>
<!-- One step darker than the title strip so a header still reads as a
header when the two are adjacent; both were #FF9B9B9B before, which
stopped working once the title strip lightened. -->
<SolidColorBrush x:Key="SettingsSectionBackgroundColor" Color="#FFE0E0E0"/>
<!-- Near-black, matching Windows 11 text; pure black is harsh on white. -->
<SolidColorBrush x:Key="TextColor" Color="#FF1A1A1A"/>
<!-- Reads as selected rather than merely grey. Long-standing Explorer
selection tint, so it stays recognisable whatever the accent colour. -->
<SolidColorBrush x:Key="SelectedRowBackgroundColor" Color="#FFE5F1FB"/>
<SolidColorBrush x:Key="MismatchColor" Color="#FFC42B1C"/>
<!-- Left-nav permission marking. WPF hardcodes the literals Red and
Orange in MainWindow.xaml; these are theme keys instead so the
dark variant is not an unreadable dark-on-dark. Both clear 4.5:1
against their variant's window background. -->
<SolidColorBrush x:Key="AccessNoneColor" Color="#FFC42B1C"/>
<SolidColorBrush x:Key="AccessLimitedColor" Color="#FFB25000"/>
<SolidColorBrush x:Key="WindowBackgroundColor" Color="#FFFFFFFF"/>
<!-- A light layer over the white window, not a distinct grey slab. -->
<SolidColorBrush x:Key="PanelBackgroundColor" Color="#FFF3F3F3"/>
<SolidColorBrush x:Key="ControlBackgroundColor" Color="#FFFFFFFF"/>
<!-- Hairline separators; #FFCCCCCC read as a drawn box. -->
<SolidColorBrush x:Key="BorderColor" Color="#FFE1E1E1"/>
<SolidColorBrush x:Key="DisabledForegroundColor" Color="#FF9A9A9A"/>
<!-- Hyperlink colour, matching UI/WPF/Themes/Light.xaml's Hyperlink style. -->
<SolidColorBrush x:Key="LinkColor" Color="#FF0066CC"/>
<SolidColorBrush x:Key="ButtonHoverBackground" Color="#FFEAEAEA"/>
<SolidColorBrush x:Key="ButtonPressedBackground" Color="#FFDCDCDC"/>
<!-- DataGrid package resources: align row selection with the app
palette (SelectedRowBackgroundColor) instead of the Fluent
accent-with-opacity default. -->
<SolidColorBrush x:Key="DataGridRowSelectedBackgroundBrush" Color="#FFE5F1FB"/>
<SolidColorBrush x:Key="DataGridRowSelectedHoveredBackgroundBrush" Color="#FFE5F1FB"/>
<SolidColorBrush x:Key="DataGridRowSelectedUnfocusedBackgroundBrush" Color="#FFE5F1FB"/>
<SolidColorBrush x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundBrush" Color="#FFE5F1FB"/>
<x:Double x:Key="DataGridRowSelectedBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedHoveredBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedUnfocusedBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundOpacity">1</x:Double>
<!-- CheckBox checked state: the WPF reference theme draws a neutral
box (ControlBackground fill, Border stroke, TextColor glyph) -
no accent blue. Mirror it by overriding the Fluent resources. -->
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillChecked" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillCheckedPointerOver" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillCheckedPressed" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeChecked" Color="#FFE1E1E1"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeCheckedPointerOver" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeCheckedPressed" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundChecked" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundCheckedPointerOver" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundCheckedPressed" Color="#FF1A1A1A"/>
<!-- RadioButton checked state: same WPF-neutral treatment as the
CheckBox above (no accent blue). -->
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFill" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFillPressed" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStroke" Color="#FFE1E1E1"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStrokePressed" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFillPointerOver" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFillPressed" Color="#FF1A1A1A"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphStroke" Color="#FF1A1A1A"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="TitleBackgroundColor" Color="#FF1E1E1E"/>
<SolidColorBrush x:Key="TitleForegroundColor" Color="#FFCCCCCC"/>
<!-- Settings-dialog section headers only. NOT TitleBackgroundColor: that
doubles as the title-bar background (= WindowBackgroundColor), which
made section headers invisible in Dark. -->
<SolidColorBrush x:Key="SettingsSectionBackgroundColor" Color="#FF3F3F3F"/>
<SolidColorBrush x:Key="TextColor" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="SelectedRowBackgroundColor" Color="#FF555555"/>
<SolidColorBrush x:Key="MismatchColor" Color="#FFFF7B72"/>
<!-- Light-on-dark counterparts of the access marking. The Light
variant's #FFC42B1C / #FFB25000 would be near-invisible here. -->
<SolidColorBrush x:Key="AccessNoneColor" Color="#FFFF7B72"/>
<SolidColorBrush x:Key="AccessLimitedColor" Color="#FFFFA657"/>
<SolidColorBrush x:Key="WindowBackgroundColor" Color="#FF1E1E1E"/>
<SolidColorBrush x:Key="PanelBackgroundColor" Color="#FF252526"/>
<SolidColorBrush x:Key="ControlBackgroundColor" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="BorderColor" Color="#FF555555"/>
<SolidColorBrush x:Key="DisabledForegroundColor" Color="#FF777777"/>
<!-- Hyperlink colour, matching UI/WPF/Themes/Dark.xaml's Hyperlink style. -->
<SolidColorBrush x:Key="LinkColor" Color="#FF6CB3F5"/>
<SolidColorBrush x:Key="ButtonHoverBackground" Color="#FF555555"/>
<SolidColorBrush x:Key="ButtonPressedBackground" Color="#FF666666"/>
<!-- DataGrid package resources: align row selection with the app
palette (SelectedRowBackgroundColor) instead of the Fluent
accent-with-opacity default. -->
<SolidColorBrush x:Key="DataGridRowSelectedBackgroundBrush" Color="#FF555555"/>
<SolidColorBrush x:Key="DataGridRowSelectedHoveredBackgroundBrush" Color="#FF555555"/>
<SolidColorBrush x:Key="DataGridRowSelectedUnfocusedBackgroundBrush" Color="#FF555555"/>
<SolidColorBrush x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundBrush" Color="#FF555555"/>
<x:Double x:Key="DataGridRowSelectedBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedHoveredBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedUnfocusedBackgroundOpacity">1</x:Double>
<x:Double x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundOpacity">1</x:Double>
<!-- CheckBox checked state: the WPF reference theme draws a neutral
box (ControlBackground fill, Border stroke, TextColor glyph) -
no accent blue. Mirror it by overriding the Fluent resources. -->
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillChecked" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillCheckedPointerOver" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillCheckedPressed" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeChecked" Color="#FF555555"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeCheckedPointerOver" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeCheckedPressed" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundChecked" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundCheckedPointerOver" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundCheckedPressed" Color="#FFEEEEEE"/>
<!-- RadioButton checked state: same WPF-neutral treatment as the
CheckBox above (no accent blue). -->
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFill" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedFillPressed" Color="#FF2D2D2D"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStroke" Color="#FF555555"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="RadioButtonOuterEllipseCheckedStrokePressed" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFillPointerOver" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphFillPressed" Color="#FFEEEEEE"/>
<SolidColorBrush x:Key="RadioButtonCheckGlyphStroke" Color="#FFEEEEEE"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
+14
View File
@@ -0,0 +1,14 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Intentionally empty.
Theme brushes for both Light and Dark live in Brushes.axaml under
ResourceDictionary.ThemeDictionaries. Avalonia auto-selects the right
variant based on Application.RequestedThemeVariant — no separate
Dark.axaml load needed.
Kept as a placeholder for any dark-only style overrides that aren't
expressible as a brush swap (rare).
-->
</Styles>
+238
View File
@@ -0,0 +1,238 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Avalonia port of UI/WPF/Themes/Default.xaml.
Translation rules:
WPF Avalonia
=========================================================================
Style TargetType="Button" Style Selector="Button"
Trigger IsMouseOver=True Style Selector="Button:pointerover"
Trigger IsPressed=True Style Selector="Button:pressed"
Trigger IsEnabled=False Style Selector="Button:disabled"
Trigger IsChecked=True Style Selector="CheckBox:checked"
Trigger IsSelected=True Style Selector="TabItem:selected"
StaticResource Foo DynamicResource Foo (theme-swap safe)
Deferred from the original (FluentTheme covers them with reasonable defaults; we
can re-template later if visual fidelity needs to match the legacy WPF look):
- ComboBox / CheckBox / RadioButton / Button / MenuItem / ScrollBar templates
- DataGrid styling (Avalonia.Controls.DataGrid is a separate package)
- ListView (WPF-only; Avalonia uses ListBox)
- Hyperlink (different model in Avalonia)
- PersonPicture* keys (UWP-specific, not used here)
Brushes live in Brushes.axaml (ThemeDictionaries), loaded into
Application.Resources.MergedDictionaries before this file. DynamicResource
lookups on the keys below resolve through the ThemeDictionary that matches
Application.RequestedThemeVariant.
-->
<!-- Window -->
<Style Selector="Window">
<Setter Property="Background" Value="{DynamicResource WindowBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<!-- Text-only controls -->
<Style Selector="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<Style Selector="Label">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<!-- Inputs -->
<Style Selector="TextBox">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="CaretBrush" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="2,1"/>
<!-- Fluent's 32px MinHeight towers over the 12pt text (the WPF app's
inputs hug the font); 24 keeps a little breathing room. -->
<Setter Property="MinHeight" Value="24"/>
</Style>
<!-- Avalonia has no PasswordBox; TextBox PasswordChar="*" is the equivalent. -->
<!-- TabControl: WPF draws a border around the tab CONTENT area; Avalonia's
Fluent template has none, and BorderBrush/Thickness on the control
itself do not reach it. Target the template's selected-content host
directly - ContentPresenter supports border properties. -->
<Style Selector="TabControl /template/ ContentPresenter#PART_SelectedContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="8"/>
</Style>
<!-- DataGrid chrome. The DataGrid package ships Fluent defaults that
ignore the app palette: headers get the panel color. Do NOT change
DataGridColumnHeader Padding here - a symmetric override starved the
narrow checkbox-column headers of content width and the select-all
checkbox vanished. Checkbox-column header alignment is handled at
the column (Margin 0,0,12,0 on the header CheckBox compensates the
Fluent left-only header padding). Selection colors live in
Brushes.axaml. -->
<Style Selector="DataGrid">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<!-- WPF sets RowBackground / AlternatingRowBackground and both grid-line
brushes; Fluent ships none of it, so rows lost their zebra striping
and the grid lost its rules. Avalonia's DataGrid has NO
AlternatingRowBackground property (verified), so the striping is
done with the nth-child selector below. -->
<Setter Property="RowBackground" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="GridLinesVisibility" Value="All"/>
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
<!-- Zebra striping: WPF's AlternatingRowBackground equivalent. -->
<Style Selector="DataGridRow:nth-child(2n)">
<Setter Property="Background" Value="{DynamicResource PanelBackgroundColor}"/>
</Style>
<Style Selector="DataGridColumnHeader">
<Setter Property="Background" Value="{DynamicResource PanelBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<!-- ComboBox + ComboBoxItem: colour overrides only; FluentTheme provides the template. -->
<Style Selector="ComboBox">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="4,2"/>
</Style>
<Style Selector="ComboBoxItem">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Padding" Value="4,2"/>
</Style>
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Style>
<!-- CheckBox / RadioButton: colour-only; FluentTheme handles glyph + states.
Background must stay Transparent: on these controls it paints the whole
root (a slab behind glyph AND label), not the glyph - the glyph's fill
comes from the Fluent template's own resources. A solid value here drew
a ControlBackgroundColor box around every radio/checkbox that sat on a
window or panel surface. -->
<Style Selector="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="RadioButton">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<!-- Button: keep the legacy hover/press tones; lean on FluentTheme for the rest. -->
<Style Selector="Button">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="5,2"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
<Style Selector="Button:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonPressedBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
<Style Selector="Button:disabled">
<Setter Property="Opacity" Value="0.5"/>
</Style>
<!-- Lists -->
<Style Selector="ListBox">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="ListBoxItem">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Padding" Value="6,2"/>
<Setter Property="MinHeight" Value="0"/>
</Style>
<Style Selector="ListBoxItem /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBackground}"/>
</Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Style>
<Style Selector="ListBoxItem:selected">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<!-- Menus -->
<Style Selector="Menu">
<Setter Property="Background" Value="{DynamicResource WindowBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Padding" Value="6,3"/>
</Style>
<Style Selector="MenuItem:disabled">
<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundColor}"/>
</Style>
<Style Selector="Separator">
<Setter Property="Background" Value="{DynamicResource BorderColor}"/>
<Setter Property="Margin" Value="0,2"/>
<Setter Property="Height" Value="1"/>
</Style>
<Style Selector="ContextMenu">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
<!-- Tabs -->
<Style Selector="TabControl">
<Setter Property="Background" Value="{DynamicResource WindowBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
<Style Selector="TabItem">
<Setter Property="Background" Value="{DynamicResource PanelBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinHeight" Value="0"/>
</Style>
<Style Selector="TabItem:selected">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
</Style>
<Style Selector="TabItem:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBackground}"/>
</Style>
<!-- Containers -->
<Style Selector="ScrollViewer">
<Setter Property="Background" Value="{DynamicResource WindowBackgroundColor}"/>
</Style>
<!-- GroupBox: not part of core Avalonia. Common substitute is HeaderedContentControl
or a Border with a label; we'll handle it per-screen if/when ported screens use it. -->
<Style Selector="ToolTip">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundColor}"/>
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
</Style>
</Styles>
+139
View File
@@ -0,0 +1,139 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Avalonia port of UI/WPF/Themes/Styles.xaml.
Paradigm shift: Avalonia has no x:Key on Style; named styles are addressed
by class instead. Consumers move from
Style="{StaticResource HoverUnderlineStyle}"
to
Classes="hover-underline"
and the selector becomes
Style Selector="TextBlock.hover-underline"
Naming convention: the original PascalCase keys translate to kebab-case
classes (HoverUnderlineStyle -> hover-underline, LinkButton -> link, etc.)
per Avalonia community conventions.
Deferred (will reimplement when a screen actually needs them):
- ErrorControl ContentControl with Tag-based DataTrigger
- ErrorBorder HasErrors-bound DataTrigger
- DataGridRow requires the Avalonia.Controls.DataGrid package
-->
<!--
info-icon: the Avalonia stand-in for WPF's InfoIcon (UI/WPF/Themes/Styles.xaml),
which is a 12x12 Rectangle filled with a DrawingBrush of three GeometryDrawings.
A glyph instead of a vector port: U+24D8 CIRCLED LATIN SMALL LETTER I scales with
the font, inherits the surrounding Foreground so it themes for free, and needs no
Drawing translation. It is the same glyph the settings dialog already renders
(Add-SettingsItem in Extensions/CoreUIAvalonia.ps1), so the two agree.
Consumers put the description on the SURROUNDING StackPanel rather than on the
glyph, so hovering the label shows it too - Avalonia's dropped InfoIcons had
moved these tips onto the Label, and this keeps that behaviour while restoring
the visible marker, without repeating the description string twice:
<StackPanel Orientation="Horizontal" ToolTip.Tip="...">
<Label Content="Export root"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
The glyph is written as a numeric entity so the markup stays ASCII - it is also
embedded in .ps1 here-strings, which ARE covered by the ANSI/CP1252 gate in
Tests/Static.Tests.ps1 (.axaml files are not, but keeping one spelling avoids
a trap when this is copied into PowerShell).
-->
<Style Selector="TextBlock.info-icon">
<Setter Property="Text" Value="&#x24D8;"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="4,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<!-- TextBlock named styles -->
<Style Selector="TextBlock.hover-underline:pointerover">
<Setter Property="TextDecorations" Value="Underline"/>
</Style>
<Style Selector="TextBlock.hover-underline-bg:pointerover">
<Setter Property="TextDecorations" Value="Underline"/>
<Setter Property="Background" Value="LightGray"/>
</Style>
<!-- LinkButton: button styled as a text link.
Templated to a TextBlock (Foreground from button), with hover underline + bg
and disabled colour driven by DisabledForegroundColor.
Avalonia note: TextDecorations on Button is not honoured by ContentPresenter
alone; the templated TextBlock owns the decoration. -->
<Style Selector="Button.link">
<!-- WPF paints Hyperlinks blue; body-text colour made links invisible
as links. LinkColor is per-variant in Brushes.axaml. -->
<Setter Property="Foreground" Value="{DynamicResource LinkColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Template">
<ControlTemplate>
<TextBlock Name="PART_Text"
Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
Background="{TemplateBinding Background}"/>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.link:pointerover /template/ TextBlock#PART_Text">
<Setter Property="TextDecorations" Value="Underline"/>
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Style>
<Style Selector="Button.link:disabled">
<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundColor}"/>
<Setter Property="Cursor" Value="Arrow"/>
</Style>
<!-- ContentButton: bare button — just the content with hover background. -->
<Style Selector="Button.content">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter Name="PART_Content"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"/>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.content:pointerover /template/ ContentPresenter#PART_Content">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Style>
<!-- ListBoxItem default: hover/selected highlights.
Default.axaml already styles ListBoxItem:selected; this adds :pointerover
and matches the legacy padding. Targets all ListBoxItems (no class), same
as the original Styles.xaml. -->
<Style Selector="ListBoxItem">
<Setter Property="Foreground" Value="{DynamicResource TextColor}"/>
<Setter Property="Padding" Value="2"/>
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Style>
<!-- Intune Manager grid, ObjectListFirstLineOnly setting (WPF parity): the
firstLine class is toggled by Add-IntuneManagerDataGridColumns. Nested
^ selector so the rule follows the class on the grid, not on the cell. -->
<Style Selector="DataGrid.firstLine">
<Style Selector="^ DataGridCell TextBlock">
<Setter Property="MaxLines" Value="1"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
</Style>
</Styles>