❔ 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
JakenVeina9mo ago
no idea, the designer is generally best to be avoided completely
Will Pittenger
Will Pittenger9mo ago
Well, it looks like if I manually typed in the class, I'd get a compile time error.
JakenVeina
JakenVeina9mo ago
typed it in how?
Will Pittenger
Will Pittenger9mo ago
In the XAML source, you can manually enter the tag you want. So you could manually enter <ComboBox/>.
JakenVeina
JakenVeina9mo ago
right and what did you type?
Hercules
Hercules9mo 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
nohopestage9mo ago
What error?
Will Pittenger
Will Pittenger9mo 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
nohopestage9mo ago
Could you show the EnumComboBox class please?
nohopestage
nohopestage9mo 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 Pittenger9mo ago
:p
nohopestage
nohopestage9mo ago
May I ask what the purpose of this control is?
Will Pittenger
Will Pittenger9mo 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
nohopestage9mo 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
Accord9mo 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
More Posts