In my WPF application I Wrote some styles for button in App.xaml and in my Window.xaml I mentioned Style="{DynamicResource MyStyle1}" for a button but that style is not getting reflected when i run the application. Let me know how do i get those styles..
This is the code i placed in App.xaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Page2.xaml">
and the following is the code in window. xaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="300">
Now as i added i am not getting the styles reflected in UI let me know if there are any issues in thecode and what is a Dynamic Resource in WPF
sss himaPosted Feb 22, 2010, 4:05 AM
Raaj KumarPosted Feb 19, 2010, 8:49 AM
Remove the TargetType. Since you are specify the style in Button like Style="{DynamicResource MyButtonStyle}" there is no need to specify in two places.
Regards,
Raaj