✅ How do I specify custom base class for user control?

I declared a custom base class derived from UserControl. Now in a second assembly, I need to derive from that. The base class doesn't provide a XAML page. Instead, the derived class would. So MyCtrl is derived from MyCtrlBase which in turn derives from UserControl. How do I specify that in the XAML? I tried the following, but it didn't work. Seems the designer doesn't see my custom base class.
<Base:MyCtrlBase
x:Class="BestChat.Prefs.Ctrls.Global"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BestChat.Prefs.Ctrls"
xmlns:Base="clr-namespace:BestChat.Prefs.Data;assembly=BestChat.Prefs.Data"
mc:Ignorable="d">
<Grid></Grid>
<Base:MyCtrlBase
x:Class="BestChat.Prefs.Ctrls.Global"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BestChat.Prefs.Ctrls"
xmlns:Base="clr-namespace:BestChat.Prefs.Data;assembly=BestChat.Prefs.Data"
mc:Ignorable="d">
<Grid></Grid>
Can someone tell me what I need to change?
1 Reply
Will Pittenger
Will PittengerOP14mo ago
Never mind. Turns out it wasn't seeing the namespaces when I used autocomplete. I manually corrected it and it now sees the correct base class.
Want results from more Discord servers?
Add your server