improve window border stuff

This commit is contained in:
bluepilledgreat 2024-10-24 17:25:35 +01:00
parent 97ff46d3f3
commit 14ee7015e6
2 changed files with 12 additions and 2 deletions

View File

@ -636,8 +636,18 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
dialog.Effect = null; dialog.Effect = null;
var theme = ParseXmlAttribute<Theme>(xmlElement, "Theme", Theme.Default); var theme = ParseXmlAttribute<Theme>(xmlElement, "Theme", Theme.Default);
if (theme == Theme.Default)
theme = App.Settings.Prop.Theme;
var wpfUiTheme = theme.GetFinal() == Theme.Dark ? Wpf.Ui.Appearance.ThemeType.Dark : Wpf.Ui.Appearance.ThemeType.Light;
dialog.Resources.MergedDictionaries.Clear(); dialog.Resources.MergedDictionaries.Clear();
dialog.Resources.MergedDictionaries.Add(new ThemesDictionary() { Theme = theme.GetFinal() == Theme.Dark ? Wpf.Ui.Appearance.ThemeType.Dark : Wpf.Ui.Appearance.ThemeType.Light }); dialog.Resources.MergedDictionaries.Add(new ThemesDictionary() { Theme = wpfUiTheme });
dialog.DefaultBorderThemeOverwrite = wpfUiTheme;
// disable default window border if border is modified
if (xmlElement.Attribute("BorderBrush") != null || xmlElement.Attribute("BorderThickness") != null)
dialog.DefaultBorderEnabled = false;
// set the margin & padding on the element grid // set the margin & padding on the element grid
dialog.ElementGrid.Margin = dialog.Margin; dialog.ElementGrid.Margin = dialog.Margin;

2
wpfui

@ -1 +1 @@
Subproject commit c4c58c589970a66b27a9de41ab1b6b6539918b52 Subproject commit cdc5d6455ea313a19a048ae1d746b3825465f341