diff --git a/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml b/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml index 426c9498c..5f307debc 100644 --- a/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml +++ b/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml @@ -10,12 +10,12 @@ - + - - - + + + @@ -24,23 +24,26 @@ - + - + + + + - + - + - + diff --git a/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml.cs b/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml.cs index 0c55bd9e3..799084a5f 100644 --- a/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml.cs +++ b/WinUIGallery/Samples/ControlPages/DropDownButtonPage.xaml.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; namespace WinUIGallery.ControlPages; @@ -11,4 +12,26 @@ public DropDownButtonPage() { this.InitializeComponent(); } + + private void EmailMenuItem_Click(object sender, RoutedEventArgs e) + { + var menuItem = sender as MenuFlyoutItem; + if (menuItem != null) + { + EmailDropDownButton.Content = menuItem.Text; + } + } + + private void EmailIconMenuItem_Click(object sender, RoutedEventArgs e) + { + var menuItem = sender as MenuFlyoutItem; + if (menuItem != null) + { + if (menuItem.Tag is string glyph) + { + EmailIcon.Glyph = glyph; + } + EmailIconText.Text = menuItem.Text; + } + } } diff --git a/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Icon.txt b/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Icon.txt index 020b8753e..328948417 100644 --- a/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Icon.txt +++ b/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Icon.txt @@ -1,20 +1,23 @@ - + - + + + + - + - + - + diff --git a/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Simple.txt b/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Simple.txt index 21065b3a1..eeccc6fda 100644 --- a/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Simple.txt +++ b/WinUIGallery/Samples/SampleCode/Buttons/DropDown/DropDownButton_Simple.txt @@ -1,9 +1,9 @@ - + - - - + + + \ No newline at end of file