I am trying to create XAML from XElements.
<Style xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Style.BasedOn>
<StaticResource>
<StaticResource.ResourceKey>
<Type xmlns="http://schemas.microsoft.com/winfx/2006/xaml">
<Type.TypeName>p:Window</Type.TypeName>
</Type>
</StaticResource.ResourceKey>
</StaticResource>
</Style.BasedOn>
...
</Style>
However, I have a problem with the markup extension x:Type. It cannot resolve the prefix p:because I do not know how to make the output XAML map the prefix pto the namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation.
Is there a way to control how XML namespace prefixes are generated? Or is it possible to force the markup extension x:Typeto use the XML namespace name instead of the prefix name?
source
share