This is a mirror of official site: http://jasper-net.blogspot.com/

ResourceDictionary in WP7

| Tuesday, October 5, 2010
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
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” >
<!– Your resources goes here –>
</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>

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source=”YourResourceDictionary.xaml” />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

Read more: XAMLGEEK

Posted via email from .NET Info

0 comments: