Add dark mode support
This commit is contained in:
parent
7289459170
commit
fc6f494f0d
62 changed files with 1090 additions and 145 deletions
|
|
@ -13,9 +13,8 @@ namespace LibationAvalonia
|
|||
public static IBrush GetBrushFromResources(string name)
|
||||
=> GetBrushFromResources(name, Brushes.Transparent);
|
||||
public static IBrush GetBrushFromResources(string name, IBrush defaultBrush)
|
||||
{
|
||||
//TODO: use ThemeVariant
|
||||
if (App.Current.Styles.TryGetResource(name, null, out var value) && value is IBrush brush)
|
||||
{
|
||||
if (App.Current.TryGetResource(name, App.Current.ActualThemeVariant, out var value) && value is IBrush brush)
|
||||
return brush;
|
||||
return defaultBrush;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue