Skip to content

Commit d688347

Browse files
authored
Merge pull request #84 from AvaloniaUtils/fixMaterial
Swap background and overlay brushes names to fix Material.Avalonia
2 parents a3e80cb + 65fbf5c commit d688347

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

DialogHost.Avalonia/DialogHostStyles.axaml.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ public DialogHostStyles(IResourceHost owner) : base(owner) {
3737
/// <summary>
3838
/// Lists of resource keys which will be used as defaults for DialogHost.Background property
3939
/// </summary>
40-
public static IReadOnlyList<string> BackgroundColorKeys { get; } = ["SystemControlPageBackgroundChromeLowBrush"];
40+
public static IReadOnlyList<string> BackgroundColorKeys { get; } =
41+
["SystemControlBackgroundAltHighBrush", "MaterialDesignPaper", "MaterialPaperBrush"];
4142

4243
/// <summary>
4344
/// Lists of resource keys which will be used as defaults for DialogHost.OverlayBackground property
4445
/// </summary>
4546
public static IReadOnlyList<string> OverlayBackgroundColorKeys { get; } =
46-
["SystemControlBackgroundAltHighBrush", "MaterialDesignPaper", "MaterialPaperBrush"];
47+
["SystemControlPageBackgroundChromeLowBrush"];
4748

4849
bool IResourceNode.HasResources => true;
4950

@@ -57,7 +58,7 @@ public DialogHostStyles(IResourceHost owner) : base(owner) {
5758
/// if the key is found; otherwise, null.
5859
/// </param>
5960
/// <returns>
60-
/// True if the resource if found, otherwise false.
61+
/// True if the resource is found, otherwise false.
6162
/// </returns>
6263
bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? value) {
6364
if (key is "DialogHostBackgroundMixinBrush") {
@@ -66,7 +67,7 @@ bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? v
6667
return true;
6768
}
6869
}
69-
70+
7071
value = Brushes.Black;
7172
return true;
7273
}
@@ -77,7 +78,7 @@ bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? v
7778
return true;
7879
}
7980
}
80-
81+
8182
value = Brushes.Black;
8283
return true;
8384
}

0 commit comments

Comments
 (0)