Fernando Sousa
Fernando Sousa

Reputation: 265

UWP app with "normal" design and Fluent Design System

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

Upvotes: 1

Views: 377

Answers (1)

Xie Steven
Xie Steven

Reputation: 8601

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;
}

Upvotes: 0

Related Questions