This question is related to a WPF application.
I have a class as below in Project “Common“. Namespace name is also same.
namespace Common
{
public ViewBase : UserControl
{
// Code
}
}
If I add a new abc.XAML file to same project (Common)…I would like to derive my code behind class(abc.xaml.cs file) from ViewBase class.
But in this case how do I write my header in XAML file ?
That is…how should refer my current namepace?
<Namespace:ViewBase x:Class=""
xmlns:x=""
....>
You can declare the namespace using
xmlnsmapping, it is “active” in the current element as well, so the namespace can be used in the tag of the element declaring it. e.g.