Saturday, December 6, 2008

Trips&Ticks: Do you know how you can use GroupName property of RadioButton for ToggleButton in WPF?

We can use GroupName property for mutually exclusive RadioButton but what can we do if we want to use mutually exclusive ToggleButton? ToggleButton doesn't have like ability. Please, do look in RadioButton what can you see? Exactly, RadioButton is inherit from ToggleButton so we can set in Template property ControlTemplate of ToggleButton. So our RadioButtons will be look like ToggleButtons besides will have GroupName property.


Hardy said...

Could you please post some sample code, and one issue I found was that I had some trouble to apply styles to the new ToggleBotton with RadioButton underneath.

RredCat said...

I use this practice in app of this article
RadioButtons (in MainWindow.xaml) are received "ToggleButtonStyle" style (it is in Resources/xamlResources.xaml)

RredCat said...

2Hardy - it is direct link to sources.