Created
January 8, 2010 02:41
-
-
Save jpoehls/271809 to your computer and use it in GitHub Desktop.
ResourceDictionary error in Silverlight
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl x:Class="ResourceDictionaryHeadache.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> | |
<UserControl.Resources> | |
<ResourceDictionary Source="/SampleData.xaml" /> | |
</UserControl.Resources> | |
<Grid x:Name="LayoutRoot"> | |
<ListBox HorizontalAlignment="Stretch" | |
VerticalAlignment="Stretch" | |
ItemsSource="{StaticResource SampleData}"> | |
</ListBox> | |
</Grid> | |
</UserControl> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.ObjectModel; | |
namespace ResourceDictionaryHeadache | |
{ | |
public class PersonList : ObservableCollection<Person> { } | |
public class Person | |
{ | |
public string Name { get; set; } | |
public int Age { get; set; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ResourceDictionary | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:Headache="clr-namespace:ResourceDictionaryHeadache"> | |
<Headache:PersonList x:Key="SampleData"> | |
<Headache:Person Name="Joe" Age="20" /> | |
<Headache:Person Name="Sam" Age="25" /> | |
<Headache:Person Name="Dave" Age="30" /> | |
</Headache:PersonList> | |
</ResourceDictionary> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Posted as question on Stackoverflow: http://stackoverflow.com/questions/2025152/error-using-resourcedictionary-in-silverlight