开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜