-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RadioMenuFlyoutItem API review #19
base: master
Are you sure you want to change the base?
Changes from all commits
dac851b
e98348d
9d6ec3d
0720df9
48b331c
25e7d5e
603c228
db94af3
0d2b269
579f119
06bf281
2c53cb6
bc30855
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Background | ||
A [MenuFlyoutItem](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.MenuFlyoutItem) is an item | ||
in a menu, be it a context menu ([MenuFlyout](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.MenuFlyout)) | ||
or a [MenuBarItem](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.MenuBarItem). | ||
|
||
The new RadioMenuFlyoutItem in this spec is a MenuFlyoutItem that displays and behaves like a radio button | ||
(can be checked/unchecked, and in a group only one is selected at a time). | ||
|
||
# Description | ||
A radio menu flyout item is a menu item that is mutually exclusive with other radio menu items in its group. | ||
This control contol allows you to present users with menus containing multiple options, where a user would choose only one of these options at a given time. | ||
|
||
|
||
# Examples | ||
|
||
## Create RadioMenuFlyoutItems | ||
*RadioMenuFlyoutItem* can be added into a *MenuBarItem*, *MenuFlyout*, or *MenuFlyoutSubItem*. The following example shows three radio menu flyout items as the content of a cascading menu flyout. | ||
|
||
![Three radio menu flyout items in a View goup that allow a user to select the size of icons](RadioMenuFlyoutItem.png) | ||
|
||
````Xaml | ||
<MenuFlyout> | ||
<MenuFlyoutSubItem Text="View"> | ||
<muxc:RadioMenuFlyoutItem Text="Small icons"/> | ||
<muxc:RadioMenuFlyoutItem Text="Medium icons" IsChecked="True"/> | ||
<muxc:RadioMenuFlyoutItem Text="Large icons"/> | ||
</MenuFlyoutSubItem> | ||
</MenuFlyout> | ||
```` | ||
|
||
## Group RadioMenuFlyoutItem into multiple sets | ||
Radio menu flyout items work in groups, and users can only select one item in a radio menu flyout item group. To create multiple groups of radio buttons within a single menu, be sure to specify the `GroupName` property of each set. | ||
|
||
![Two groups of radio menu flyout items within a View menu bar item](RadioMenuFlyoutItem2.png) | ||
|
||
````Xaml | ||
<muxc:MenuBar> | ||
<muxc:MenuBarItem Title="View"> | ||
<MenuFlyoutItem Text="Open"/> | ||
<MenuFlyoutSeparator/> | ||
<muxc:RadioMenuFlyoutItem Text="Landscape" GroupName="OrientationGroup"/> | ||
<muxc:RadioMenuFlyoutItem Text="Portrait" GroupName="OrientationGroup" IsChecked="True"/> | ||
<MenuFlyoutSeparator/> | ||
<muxc:RadioMenuFlyoutItem Text="Small icons" GroupName="SizeGroup"/> | ||
<muxc:RadioMenuFlyoutItem Text="Medium icons" IsChecked="True" GroupName="SizeGroup"/> | ||
<muxc:RadioMenuFlyoutItem Text="Large icons" GroupName="SizeGroup"/> | ||
</muxc:MenuBarItem> | ||
</muxc:MenuBar> | ||
```` | ||
|
||
# API Details | ||
````c# | ||
[webhosthidden] | ||
unsealed runtimeclass RadioMenuFlyoutItem : Windows.UI.Xaml.Controls.MenuFlyoutItem | ||
{ | ||
RadioMenuFlyoutItem(); | ||
|
||
/// Gets or sets whether the RadioMenuFlyoutItem is checked | ||
Boolean IsChecked; | ||
|
||
/// Gets or sets the name that specifies which RadioMenuFlyoutItem controls are mutually exclusive | ||
String GroupName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's scoped to siblings in whatever flyout it's in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommend: Need to update this in the description. |
||
|
||
static Windows.UI.Xaml.DependencyProperty IsCheckedProperty{ get; }; | ||
static Windows.UI.Xaml.DependencyProperty GroupNameProperty{ get; }; | ||
} | ||
```` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RadioButton
derives fromToggleButton
, butRadioMenuFlyoutItem
doesn't derive fromToggleMenuFlyoutItem
. Intentional?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did do that intentionally but I could be convinced otherwise. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does/should it support ThreeState?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should, that doesn't feel like a compelling scenario inside a context menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: Based on that, not deriving from ToggleMenuFlyoutItem sounds right.