If you put style in app.xmal, then you can get the style with the code like:
Style = Application.Current.Resources["myStyle"] as Style;
But if I put style in a dictionary resource of a separate file Styles.xmal like:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Then how to get the style in code?
Found out reason: code
Style = Application.Current.Resources["myStyle"] as Style;
works fine. My problem is caused by some other factors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With