Sign In|Join
Home/Silverlight.NET Forums/Programming with .NET - General/Object creation by using xaml fails/Re: Object creation by using xaml fails
Contributor
3308 Points
565 Posts
Jun 20, 2008 05:16 PM | LINK
This is because you're using a UIElement as the object for your Grid. UIElement does not containt Resources.
Try using:
Grid grid = XamlReader.Load(xaml) as Grid;
instead of:
UIElement grid = XamlReader.Load(xaml) as UIElement;
robhouweling
Contributor
3308 Points
565 Posts
Re: Object creation by using xaml fails
Jun 20, 2008 05:16 PM | LINK
This is because you're using a UIElement as the object for your Grid. UIElement does not containt Resources.
Try using:
Grid grid = XamlReader.Load(xaml) as Grid;
instead of:
UIElement grid = XamlReader.Load(xaml) as UIElement;
Cheers!
Rob Houweling
My blog