DynamicResource: DynamicResources are resolved at runtime. Use
DynamicResources when the value of the resource could change during the
lifetime of the Application.
I will show you an example regarding DynamicResource.
<Window.Resources>
<SolidColorBrush
x:Key="brush"
Color="BlueViolet"></SolidColorBrush>
<Style
TargetType="Border" x:Key="background">
<Setter
Property="Background"
Value="Green"></Setter>
</Style>
</Window.Resources>
In my WPF application page I've one textbox and two ellipses. In Window.Resources I defined the SolidColorBrush and the Style properties.
In above code you can observe x: Key attribute. x: Key uniquely identifies elements that are created and referenced in a XAML-defined dictionary.
Here I'm using above resources. Have a look at below code.
You can use this syntax in xaml design page: {DynamicResource x:keyName}
<Grid>


Sonia VzPosted Jul 21, 2017, 2:57 PM
Thanks, Simple and very useful.