c# - How to Combine LocalizedStrings and ResourceDictionary tags in the Application.Resources of the App.xaml file -
i use style file localizedstrings file resources, in windows phone 8 application, using app.xaml.
i know add style file resource can use:
<application.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="assets/resources/styles.xaml" /> </resourcedictionary.mergeddictionaries> </resourcedictionary> </application.resources> and declare localizedstrings resource can use:
<application.resources> <local:localizedstrings xmlns:local="clr-namespace:localizzazione" x:key="localizedstrings"/> </application.resources> both work in app individually. have issues when trying use both resources @ same time.
visual studio prevent me add localizedstrings tag above resourcedictionary tag, asking me key, , vs prevent me add localizedstring tag inside resourcedictionnary tag. vs quiet when following:
<application.resources> <local:localizedstrings xmlns:local="clr-namespace:localizzazione" x:key="localizedstrings"/> <resourcedictionary x:key="myappdict"> <resourcedictionary.mergeddictionaries> <resourcedictionary source="assets/resources/styles.xaml" /> </resourcedictionary.mergeddictionaries> </resourcedictionary> </application.resources> but when running app got xamlparseexception additional info: failed assign property system.windows.resourcedictionnary.source.
so have idea on how combine 2 resources in app.xaml file?
you can add both using below code.
<application.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="./resources/themeresources.xaml"/> </resourcedictionary.mergeddictionaries> <local:localizedstrings xmlns:local="clr-namespace:localizzazione" x:key="localizedstrings"/> </resourcedictionary> </application.resources> i using both in application & not showing exception there.
Comments
Post a Comment