Add back mica for the Fluent dialog style

The Children Yearn For The Mica
This commit is contained in:
pizzaboxer 2023-07-25 21:31:11 +01:00
parent 8bbad57eb3
commit 67f0fdd1f4
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
3 changed files with 21 additions and 2 deletions

View File

@ -11,6 +11,7 @@
ResizeMode="NoResize"
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
@ -37,7 +38,10 @@
</StackPanel>
</Grid>
<Border Grid.Row="2" Padding="15" Background="{ui:ThemeResource SolidBackgroundFillColorSecondaryBrush}">
<Border Grid.Row="2" Padding="15">
<Border.Background>
<SolidColorBrush Color="{ui:ThemeResource SolidBackgroundFillColorSecondary}" Opacity="{Binding FooterOpacity, Mode=OneTime}" />
</Border.Background>
<Button Margin="0" Content="Cancel" Width="120" HorizontalAlignment="Right" IsEnabled="{Binding CancelEnabled, Mode=OneWay}" Command="{Binding CancelInstallCommand}" />
</Border>
</Grid>

View File

@ -66,7 +66,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
public FluentDialog()
{
_viewModel = new BootstrapperDialogViewModel(this);
_viewModel = new FluentDialogViewModel(this);
DataContext = _viewModel;
Title = App.Settings.Prop.BootstrapperTitle;
Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();

View File

@ -0,0 +1,15 @@
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace Bloxstrap.UI.ViewModels.Bootstrapper
{
public class FluentDialogViewModel : BootstrapperDialogViewModel
{
public double FooterOpacity => Environment.OSVersion.Version.Build >= 22000 ? 0.4 : 1;
public FluentDialogViewModel(IBootstrapperDialog dialog) : base(dialog)
{
}
}
}