Suppose I have a top-level ResourceDictionary
element in a XAML file with no C# code-behind. How can I put this element in a specific namespace?
views:
41answers:
2
A:
I'm not sure if you can -- but I've never seen this done.
What I have seen is putting ResourceDictionary XAML files in a directory structure in an assembly, and getting it via the Pack URI syntax.
Dr. WPF has an interesting post on getting ResourceDictionaries in code here.
micahtan
2009-07-06 20:13:42
A:
It is much simpler than I had thought:
<ResourceDictionary x:Class="SomeNamespace.SomeClassName"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
emddudley
2009-07-18 22:44:26