Namespace problem while loading XAML dynamically
I have a WPF application that load a FlowDocument from a embedded resource, with the following code
object something = XamlReader.Load( stream );
The parser tell me he cannot find the "clr-namespace开发者_JS百科:ReportPrinter" at
<FlowDocument
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:ReportPrinter"
>
A quick search with google tell me i need to specify the assembly, but how i can do it?
You simply append the name of the assembly containing the specified class to the definition of the namespace. A good example of the correct string can be found at MSDN. There is also a description about the different possibilities to describe a certain assembly.
精彩评论