I am new to WPF and i need to learn the static resource and dynamic resource. i have tried to set the style for button using the Dynamic Resource and change the style using button Click but the style is not changed. please refer my code i used for change the button style using click
Codes :
Click :
private void Content_Click(object sender, RoutedEventArgs e)
{
this.Resources.Add("Style1", new SolidColorBrush(Colors.Blue));
}
Could you please any one guide me how to achieve my requirement.
ali tuncerPosted Mar 10, 2016, 11:55 PM
try this :
Click :
private void Content_Click(object sender, RoutedEventArgs e)
{
Resources["Color"] = new SolidColorBrush(Colors.Blue);
}
Suthahar JegatheesanPosted Sep 30, 2021, 2:50 AM
Buttonstylewith the newstyle: