❔ WPF derived combo box doesn't show up in namespace

I created a class derived from System.Windows.Controls.ComboBox. I then rebuilt the DLL containing the combo box. Other controls show up in the list of controls ready to drop into my window. But not the combo box. Is there something that prevents controls not derived from System.Windows.Controls.UserControl from showing up? My class doesn't have a XAML file. Could that be it?
16 Replies
JakenVeina
JakenVeina15mo ago
no idea, the designer is generally best to be avoided completely
Will Pittenger
Will PittengerOP15mo ago
Well, it looks like if I manually typed in the class, I'd get a compile time error.
JakenVeina
JakenVeina15mo ago
typed it in how?
Will Pittenger
Will PittengerOP15mo ago
In the XAML source, you can manually enter the tag you want. So you could manually enter <ComboBox/>.
JakenVeina
JakenVeina15mo ago
right and what did you type?
Hercules
Hercules15mo ago
i recommend that your read more about System.Windows.Controls.ComboBox and its examples and usage. https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.combobox?view=windowsdesktop-7.0
ComboBox Class (System.Windows.Controls)
Represents a selection control with a drop-down list that can be shown or hidden by clicking the arrow on the control.
nohopestage
nohopestage15mo ago
What error?
Will Pittenger
Will PittengerOP15mo ago
Error XDG0008 The name "EnumComboBox" does not exist in the namespace "clr-namespace:BestChat.GUI.Ctrls;assembly=BestChat.GUI.Ctrls". Best Chat.GUI B:\Contents\Best Chat\Code\Best Chat.GUI\PrefsWnd.xaml 525
Error XLS0414 The type 'Ctrls:EnumComboBox' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. Best Chat.GUI B:\Contents\Best Chat\Code\Best Chat.GUI\PrefsWnd.xaml 525
Error XDG0008 The name "EnumComboBox" does not exist in the namespace "clr-namespace:BestChat.GUI.Ctrls;assembly=BestChat.GUI.Ctrls". Best Chat.GUI B:\Contents\Best Chat\Code\Best Chat.GUI\PrefsWnd.xaml 525
Error XLS0414 The type 'Ctrls:EnumComboBox' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. Best Chat.GUI B:\Contents\Best Chat\Code\Best Chat.GUI\PrefsWnd.xaml 525
nohopestage
nohopestage15mo ago
Could you show the EnumComboBox class please?
nohopestage
nohopestage15mo ago
It's called EnumComboBoxCtrl and you're trying to use EnumComboBox Also, I'm not sure if you can use generic classes in xaml
Will Pittenger
Will PittengerOP15mo ago
:p
nohopestage
nohopestage15mo ago
May I ask what the purpose of this control is?
Will Pittenger
Will PittengerOP15mo ago
Well, I want to associate the values in an enum with translatable text. I can't be assured of the order due to sorting. So the class will take the enum, look up a value from an attribute and put that into the combobox as the display string.
nohopestage
nohopestage15mo ago
Stack Overflow
WPF How to bind an enum with Description to a ComboBox
How can I bind an enum with Description (DescriptionAttribute) to a ComboBox? I got an enum: public enum ReportTemplate { [Description("Top view")] TopView, [Description("Section vie...
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server