UWP app with "normal" design and Fluent Design System

370 Views Asked by At

I have an UWP app (published in Windows Store), and my app have the "normal" desing, I like update my app for Fluent Design System. But I would like to add an option in the settings of my app so the user can choose whether he wanted the Fluent Design System (acrylic and transparent effect) or the normal/traditional design. It is possible? If so how do I do it? I've tried searching for a solution and I can not find anything

1

There are 1 best solutions below

0
On

As BoltClock & iam.Carrot's said, I just made a simple code sample for your reference. You could use a flag to switch between the "normal" and "Fluent" design.

<Application.Resources>
    <ResourceDictionary>
        <AcrylicBrush x:Key="MyAcrylicBrush"
        BackgroundSource="HostBackdrop"
        TintColor="#FFFF0000"
        TintOpacity="0.8"
        FallbackColor="#FF7F0000"/>

        <SolidColorBrush x:Key="default"
        Color="{ThemeResource SystemColorWindowColor}"/>
    </ResourceDictionary>
</Application.Resources>
if (flag) //e.g, true -- acrylic
{
    grid.Background = Application.Current.Resources["MyAcrylicBrush"] as Brush;
}
else
{
    grid.Background = Application.Current.Resources["default"] as Brush;
}