Skip to content

Commit

Permalink
New sample: RadioMenuFlyoutItem (#1611)
Browse files Browse the repository at this point in the history
## Description
Add a new sample about `RadioMenuFlyoutItem` in `MenuFlyout` page.

## Motivation and Context
I just happened to come across this class in looking for derived class
from `MenuFlyoutItem`.

## How Has This Been Tested?
Manual

## Screenshots (if appropriate):

![image](https://github.com/user-attachments/assets/6ff695ca-7b78-423a-91d6-b6bdb8d8e7bb)
![image](https://github.com/user-attachments/assets/eac14a22-f96f-42cc-bff2-f8e01421a73c)
  • Loading branch information
HO-COOH authored Sep 24, 2024
1 parent 466107f commit d7a2ee4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
33 changes: 32 additions & 1 deletion WinUIGallery/ControlPages/MenuFlyoutPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
Expand Down Expand Up @@ -207,6 +207,37 @@
&lt;MenuFlyoutItem Text="Select"/&gt;
&lt;/MenuFlyout&gt;
&lt;/Button.Flyout&gt;
&lt;/Button&gt;
</x:String>
</local:ControlExample.Xaml>
</local:ControlExample>

<local:ControlExample x:Name="Example6" HeaderText="A MenuFlyout with RadioMenuFlyoutItems">
<Button x:Name="Control6" Content="Options">
<Button.Flyout>
<MenuFlyout>
<RadioMenuFlyoutItem Text="Landscape" GroupName="OrientationGroup"/>
<RadioMenuFlyoutItem Text="Portrait" GroupName="OrientationGroup" IsChecked="True"/>
<MenuFlyoutSeparator/>
<RadioMenuFlyoutItem Text="Small icons" GroupName="SizeGroup"/>
<RadioMenuFlyoutItem Text="Medium icons" IsChecked="True" GroupName="SizeGroup"/>
<RadioMenuFlyoutItem Text="Large icons" GroupName="SizeGroup"/>
</MenuFlyout>
</Button.Flyout>
</Button>
<local:ControlExample.Xaml>
<x:String xml:space="preserve">
&lt;Button Content="Options"&gt;
&lt;Button.Flyout&gt;
&lt;MenuFlyout&gt;
&lt;RadioMenuFlyoutItem Text="Landscape" GroupName="OrientationGroup"/&gt;
&lt;RadioMenuFlyoutItem Text="Portrait" GroupName="OrientationGroup" IsChecked="True"/&gt;
&lt;MenuFlyoutSeparator/&gt;
&lt;RadioMenuFlyoutItem Text="Small icons" GroupName="SizeGroup"/&gt;
&lt;RadioMenuFlyoutItem Text="Medium icons" IsChecked="True" GroupName="SizeGroup"/&gt;
&lt;RadioMenuFlyoutItem Text="Large icons" GroupName="SizeGroup"/&gt;
&lt;/MenuFlyout&gt;
&lt;/Button.Flyout&gt;
&lt;/Button&gt;
</x:String>
</local:ControlExample.Xaml>
Expand Down
8 changes: 8 additions & 0 deletions WinUIGallery/DataModel/ControlInfoData.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@
"Title": "MenuFlyoutItem - API",
"Uri": "https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.menuflyoutitem"
},
{
"Title": "MenuFlyoutSubItem - API",
"Uri": "https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.menuflyoutsubitem"
},
{
"Title": "MenuFlyoutSeparator - API",
"Uri": "https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.menuflyoutseparator"
Expand All @@ -441,6 +445,10 @@
"Title": "ToggleMenuFlyoutItem - API",
"Uri": "https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.togglemenuflyoutitem"
},
{
"Title": "RadioMenuFlyoutItem - API",
"Uri": "https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.radiomenuflyoutitem"
},
{
"Title": "Guidelines",
"Uri": "https://learn.microsoft.com/windows/apps/design/controls/menus"
Expand Down

0 comments on commit d7a2ee4

Please sign in to comment.