Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Why the default styles are modified when I add a resource to App.Current.Resources?

$
0
0

I have a dictionary resources, that I want to add to the App.Current.Resources. I do it in this way:

System.Windows.ResourceDictionary myDic= new System.Windows.ResourceDictionary();
miDiccionario.Source = new Uri("../Resources/Dics/GUI.xaml", UriKind.RelativeOrAbsolute);

 App.Current.Resources.MergedDictionaries.Add(myDic);

This code is in the constructor of the intial view model. The problem is that when I add the the dictionary all the application changes the aspect, for example, the height of the row in the datagrid becomes greater. If I don't add the resource, the aspect is normal.

Can I add dictionaries to the App.Current.Resources or is not a good idea?

thanks so much.


Viewing all articles
Browse latest Browse all 18858

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>