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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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. Thexmlnsattribute 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.