Reputation: 11090
I am trying to creating a combobox with checkboxes on each line to allow multiple selecting. Would this be better as a User Control or Custom Control?
I haven't created a control before so just looking for a little advice on what direction I need to head.
Thanks.
Upvotes: 20
Views: 12901
Reputation: 771
UserControl (Composition)
CustomControl (Extending an existing control)
In your case, I think UserControl
would be better; here's an example for you:
<CheckBox Content="Property" IsChecked="{Binding Path=SomeProperty}" />
<ComboBox IsEnabled="{Binding Path=Enabled}" />
Upvotes: 67
Reputation: 9565
I would say use a datatemplate.
Like this: Looking for a WPF ComboBox with checkboxes
It's a lot more simple than trying to create your own control. :)
Upvotes: 13