views:

23

answers:

1

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't have to write namespace:Class, just Class.

A: 

There is no way to combine namespaces in XAML that is equivlant to the C# using. XAML is first an XML format and adhears to the the XML namespace standard which doesn't support arbitrarily combinding 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.

chuckj