I want to paint Stack Panel surface using Acrylic brush.
<StackPanel Background="{ThemeResource SystemControlAcrylicElementBrush}"></StackPanel>
It works for me but there is a problem when I want to change Tint color and opacity. There is a following code to change it:
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<AcrylicBrush x:Key="MyAcrylicBrush"
BackgroundSource="HostBackdrop"
TintColor="#FFFF0000"
TintOpacity="0.8"
FallbackColor="#FF7F0000"/>
</ResourceDictionary>
I don't know where should I place it and rename brush for this?
<StackPanel Background="{ThemeResource **MyAcrylicBrush**}"></StackPanel>
Thanks for help. P.S. You need Windows Insider SDK and system build 16190 or higher
Method 1:
Add
ResourceDictionary.ThemeDictionaries
inApplication.Resources
In App.xaml
Method 2:
As @jsmyth886 answered
Add a separate
ResourceDictionary
file and place yourResourceDictionary.ThemeDictionaries
codeYou
MergedDictionaries
inApp.xaml
to Merged yourResourceDictionary
fileFor more Info: ResourceDictionary and XAML resource references, XAML for Windows 10 Controls - Styling