background colours for aero theme

This commit is contained in:
bluepilledgreat 2024-02-04 15:03:42 +00:00
parent f9a5e89d0e
commit 8004e7322a
3 changed files with 10 additions and 3 deletions

View File

@ -23,8 +23,8 @@
WindowStyle="None" WindowStyle="None"
mc:Ignorable="d"> mc:Ignorable="d">
<!-- Background is a hack to stop weirdness --> <!-- Background is for Aero theme only -->
<Grid Background="#01ffffff"> <Grid Background="{Binding Path=BackgroundColourBrush, Mode=OneTime}">
<!-- Allow for drag --> <!-- Allow for drag -->
<ui:TitleBar <ui:TitleBar
VerticalAlignment="Top" VerticalAlignment="Top"

View File

@ -25,7 +25,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
/// </summary> /// </summary>
public partial class ProgressFluentDialog : IBootstrapperDialog public partial class ProgressFluentDialog : IBootstrapperDialog
{ {
private readonly BootstrapperDialogViewModel _viewModel; private readonly ProgressFluentDialogViewModel _viewModel;
public Bloxstrap.Bootstrapper? Bootstrapper { get; set; } public Bloxstrap.Bootstrapper? Bootstrapper { get; set; }

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Media;
using Wpf.Ui.Appearance; using Wpf.Ui.Appearance;
namespace Bloxstrap.UI.ViewModels.Bootstrapper namespace Bloxstrap.UI.ViewModels.Bootstrapper
@ -10,6 +11,7 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper
public class ProgressFluentDialogViewModel : BootstrapperDialogViewModel public class ProgressFluentDialogViewModel : BootstrapperDialogViewModel
{ {
public BackgroundType WindowBackdropType { get; set; } = BackgroundType.Mica; public BackgroundType WindowBackdropType { get; set; } = BackgroundType.Mica;
public SolidColorBrush BackgroundColourBrush { get; set; } = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
[Obsolete("Do not use this! This is for the designer only.", true)] [Obsolete("Do not use this! This is for the designer only.", true)]
public ProgressFluentDialogViewModel() : base() public ProgressFluentDialogViewModel() : base()
@ -18,6 +20,11 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper
public ProgressFluentDialogViewModel(IBootstrapperDialog dialog, bool aero) : base(dialog) public ProgressFluentDialogViewModel(IBootstrapperDialog dialog, bool aero) : base(dialog)
{ {
WindowBackdropType = aero ? BackgroundType.Aero : BackgroundType.Mica; WindowBackdropType = aero ? BackgroundType.Aero : BackgroundType.Mica;
if (aero)
BackgroundColourBrush = App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Light ?
new SolidColorBrush(Color.FromArgb(32, 255, 255, 255)) :
new SolidColorBrush(Color.FromArgb(32, 0, 0, 0));
} }
} }
} }