WPF Ribbon: ToggleButton Groups?

I just started playing with the Microsoft release 08/2010 WPF Ribbon . The basics look pretty simple, but how would I create a RibbonToggleButton group that would allow me to select only one button in a group at a time, similar to how radio buttons should behave? Thank you for your help.

+3
source share
2 answers

The behavior of a Ribbon ToggleButton is not the same as a group of radio buttons where you can set a group, and only one can be checked at a time. You will need to record an event RibbonToggleButton.Checkedto handle the desired behavior. There is nothing wrong with this method (considering mvvm), since the code specifically deals with the behavior of the user interface.

We made a similar implementation using the first version of the Ribbon release:

  • create RibbonGroup
  • add RibbonToggleButtons to the RibbonGroup
  • connect the checked event to each button (they all have the same handler)

The checked event will find all the RibbonToggleButton in the RibbonGroup and remove them, and then check the checked button.

WPF?

+4

WPF WPF , .

0

Source: https://habr.com/ru/post/1759031/


All Articles