This is a migrated thread and some comments may be shown as answers.

Is RadSplitButton.DefaultItem in WPF?

1 Answer 74 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 11 Jan 2013, 12:07 AM
The Working with RadSplitButton Items webpage shows a DefaultItem property for RadSplitButton. Is this available in the WPF RadSplitButton? It doesn't appear so.

I have the need for this functionality in our MVVM WPF application (using Caliburn Micro as our MVVM framework).

In the Style for this control, I can set a property as shown below:

<Setter Property="cal:Message.Attach" Value="[Event Click]=[Action CreateNewLink2]"/>

CreateNewLink2 is fired when I click the button without dropping down the control, but if I create a guard property for this method, the entire control is disabled. I need the dropdown to dropdown even when the guard property prevents executing the command (CreateNewLink2) since there are commands on the dropdown that can be enabled even when the CreateNewLink2 (command for the button) is disabled.

Can this be done?

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 11 Jan 2013, 10:42 AM
Hello Kevin,

The DefaultItem property is available in our WinForms controls only. Our WPF RadSplitButton is composed of a RadButton (which executes the Command) and a RadToggleButton (which opens the DropDown content). In order to achieve your goal I extracted the default template of the control and I bound the IsEnabled properties of the RadButton and the RadToggleButton to properties defined in the DataContext of the RadSplitButton. You can apply the same logic to bind the Command property of both buttons to different command instances.

Please take a look at the attached project and let me know if it works for you.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Buttons
Asked by
Kevin
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or