Is there a way to include namespaces in xaml so I don't have to write the extension?
Is there a way to do 'using' in XAML i.e. declare a namespace and include it in the general xaml scope so I don开发者_StackOverflow社区't have to write namespace:Class, just Class.
There is no way to combine namespaces in XAML that is equivalent to the C# using. XAML is first an XML format and adheres to the the XML namespace standard which doesn't support arbitrarily combining namespaces.
You can, however, change what the default namespace is for a region of XAML by using xmlns="..."
attribute in an element. The xmlns
attribute will change the default namespace for the element and all of its contained elements. If you find yourself using a prefix a lot consider temporarily changing the default namespace.
精彩评论