Add options flyout#804
Conversation
8859bd1 to
23e1d60
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds an optional “Options” flyout button to the Ribbon control template, enabling ribbon-level configuration actions (eg “always show”, “auto hide”) when a FlyoutBase is attached.
Changes:
- Added an
OptionsButtonto theRibboncontrol template and a newOptionsGroupvisual state to control its visibility. - Introduced new
Ribbondependency properties:OptionsFlyout,OptionsAccessibleName, andOptionsAccessKey. - Updated the ribbon sample to demonstrate attaching a
MenuFlyoutto the new options button.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| components/Ribbon/src/RibbonStyle.xaml | Adds an options button to the template and a visual state group to show/hide it. |
| components/Ribbon/src/Ribbon.cs | Adds DPs and visual-state logic intended to toggle the options button based on whether a flyout is set. |
| components/Ribbon/samples/RibbonCustomSample.xaml | Demonstrates the new options flyout feature in the sample page. |
Comments suppressed due to low confidence (1)
components/Ribbon/src/Ribbon.cs:88
- OptionsAccessibleNameProperty is wired to OnOptionsFlyoutPropertyChanged, which appears to be a copy/paste mistake (changing the accessible name shouldn't toggle the OptionsVisible/OptionsCollapsed visual state). This callback should be removed from OptionsAccessibleNameProperty and instead applied to OptionsFlyoutProperty (or renamed/repurposed if intended).
public static readonly DependencyProperty OptionsAccessibleNameProperty = DependencyProperty.Register(
nameof(OptionsAccessibleName),
typeof(string),
typeof(Ribbon),
new PropertyMetadata(string.Empty, OnOptionsFlyoutPropertyChanged));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avid29
left a comment
There was a problem hiding this comment.
Looks good to me.
Might suggest reordering the members so the dependency properties are grouped and their corresponding implementation properties are beneath the constructor. Currently we have no official pattern.
| new PropertyMetadata(string.Empty)); | ||
|
|
||
| /// <summary> | ||
| /// The access key to set on the options flyout button. |
There was a problem hiding this comment.
| /// The access key to set on the options flyout button. | |
| /// Gets or sets the access key to set on the options flyout button. |
| new PropertyMetadata(string.Empty)); | ||
|
|
||
| /// <summary> | ||
| /// The accessible name for the options button. |
There was a problem hiding this comment.
| /// The accessible name for the options button. | |
| /// Gets or sets the accessible name for the options button. |
This is the standard comment pattern for a property
| new PropertyMetadata(null, OnOptionsFlyoutPropertyChanged)); | ||
|
|
||
| /// <summary> | ||
| /// The flyout to display when the user clicks on the ribbon options button. |
There was a problem hiding this comment.
| /// The flyout to display when the user clicks on the ribbon options button. | |
| /// Gets or sets the flyout to display when the user clicks on the ribbon options button. |
What
I'm adding an optional
OptionsFlyoutbutton to theRibboncontrol. It allows us to add some configuration options to the ribbon like "always show", "auto hide"...How
I'm adding a new set of properties to the
Ribboncontrol to attached aFlyoutto the new options button.The options button will only be displayed if there is a flyout attached to the ribbon. It can have an access key and an automation name.
Screenshots