From 4119792514b89f72da81d7a4f02c22531a319a91 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 3 Feb 2024 21:27:09 +0000 Subject: [PATCH] add aero --- Bloxstrap/Enums/BootstrapperStyle.cs | 1 + .../Bootstrapper/ProgressFluentDialog.xaml | 4 ++-- .../Bootstrapper/ProgressFluentDialog.xaml.cs | 4 ++-- Bloxstrap/UI/Frontend.cs | 3 ++- .../ProgressFluentDialogViewModel.cs | 23 +++++++++++++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 Bloxstrap/UI/ViewModels/Bootstrapper/ProgressFluentDialogViewModel.cs diff --git a/Bloxstrap/Enums/BootstrapperStyle.cs b/Bloxstrap/Enums/BootstrapperStyle.cs index 6b1d36b..118f3d2 100644 --- a/Bloxstrap/Enums/BootstrapperStyle.cs +++ b/Bloxstrap/Enums/BootstrapperStyle.cs @@ -9,5 +9,6 @@ FluentDialog, ByfronDialog, ProgressFluentDialog, + ProgressFluentAeroDialog } } diff --git a/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml b/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml index 77ccc24..74df835 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml +++ b/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml @@ -11,14 +11,14 @@ Width="520" Height="280" MinHeight="0" - d:DataContext="{d:DesignInstance vms:BootstrapperDialogViewModel, + d:DataContext="{d:DesignInstance vms:ProgressFluentDialogViewModel, IsDesignTimeCreatable=True}" AllowsTransparency="True" Background="{ui:ThemeResource ApplicationBackgroundBrush}" Closing="UiWindow_Closing" ExtendsContentIntoTitleBar="True" ResizeMode="NoResize" - WindowBackdropType="Acrylic" + WindowBackdropType="{Binding Path=WindowBackdropType, Mode=OneTime}" WindowStartupLocation="CenterScreen" WindowStyle="None" mc:Ignorable="d"> diff --git a/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml.cs b/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml.cs index 710682e..83405c8 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/ProgressFluentDialog.xaml.cs @@ -85,12 +85,12 @@ namespace Bloxstrap.UI.Elements.Bootstrapper } #endregion - public ProgressFluentDialog() + public ProgressFluentDialog(bool aero) { InitializeComponent(); ApplyTheme(); - _viewModel = new FluentDialogViewModel(this); + _viewModel = new ProgressFluentDialogViewModel(this, aero); DataContext = _viewModel; Title = App.Settings.Prop.BootstrapperTitle; Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource(); diff --git a/Bloxstrap/UI/Frontend.cs b/Bloxstrap/UI/Frontend.cs index d151115..9ba7fad 100644 --- a/Bloxstrap/UI/Frontend.cs +++ b/Bloxstrap/UI/Frontend.cs @@ -57,7 +57,8 @@ namespace Bloxstrap.UI BootstrapperStyle.ProgressDialog => new ProgressDialog(), BootstrapperStyle.FluentDialog => new FluentDialog(), BootstrapperStyle.ByfronDialog => new ByfronDialog(), - BootstrapperStyle.ProgressFluentDialog => new ProgressFluentDialog(), + BootstrapperStyle.ProgressFluentDialog => new ProgressFluentDialog(false), + BootstrapperStyle.ProgressFluentAeroDialog => new ProgressFluentDialog(true), _ => new FluentDialog() }; } diff --git a/Bloxstrap/UI/ViewModels/Bootstrapper/ProgressFluentDialogViewModel.cs b/Bloxstrap/UI/ViewModels/Bootstrapper/ProgressFluentDialogViewModel.cs new file mode 100644 index 0000000..1f3d7b6 --- /dev/null +++ b/Bloxstrap/UI/ViewModels/Bootstrapper/ProgressFluentDialogViewModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Wpf.Ui.Appearance; + +namespace Bloxstrap.UI.ViewModels.Bootstrapper +{ + public class ProgressFluentDialogViewModel : BootstrapperDialogViewModel + { + public BackgroundType WindowBackdropType { get; set; } = BackgroundType.Mica; + + [Obsolete("Do not use this! This is for the designer only.", true)] + public ProgressFluentDialogViewModel() : base() + { } + + public ProgressFluentDialogViewModel(IBootstrapperDialog dialog, bool aero) : base(dialog) + { + WindowBackdropType = aero ? BackgroundType.Aero : BackgroundType.Mica; + } + } +}