WP7 is based on Silverlight 3+ and by default it’s not possible to create a new resource dictionary. However it’s pretty easy to work around – just follow the same guidelines as if it was in Silverlight 3. 1) Create a new Class and rename it YourResourceDictionary.xaml (or whatever fits you).2) Replace the content from the Class with the content you need:<ResourceDictionary
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”</ResourceDictionary>3) Unless you’re creating a Generic.xaml resource dictionary in the Themes folder you need to add the resource dictionary to the list of merged resource dictionaries in your App.xaml file: <Application.Resources>
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” >
<!– Your resources goes here –>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source=”YourResourceDictionary.xaml” />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary></Application.Resources> Read more: XAMLGEEK
0 comments:
Post a Comment