Skip to content

Commit

Permalink
Example code for DropDownButton
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Nov 3, 2024
1 parent 9a10296 commit fca4f5b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel>
<local:ControlExample HeaderText="Simple DropDownButton" XamlSource="Buttons/DropDown/DropDownButton_Simple.txt">
<local:ControlExample x:Name="Example1" HeaderText="Simple DropDownButton">
<StackPanel x:Name="Control1" Orientation="Horizontal">
<ui:DropDownButton Content="Email">
<ui:DropDownButton.Flyout>
Expand All @@ -24,27 +24,27 @@
</StackPanel>
</local:ControlExample>

<local:ControlExample HeaderText="DropDownButton with Icons" XamlSource="Buttons/DropDown/DropDownButton_Icon.txt">
<local:ControlExample x:Name="Example2" HeaderText="DropDownButton with Icons">
<StackPanel x:Name="Control2" Orientation="Horizontal">
<ui:DropDownButton AutomationProperties.Name="Email">
<ui:DropDownButton.Content>
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE715;" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Mail}" />
</ui:DropDownButton.Content>
<ui:DropDownButton.Flyout>
<ui:MenuFlyout Placement="Bottom">
<MenuItem Header="Send">
<MenuItem.Icon>
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE725;" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Send}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Reply">
<MenuItem.Icon>
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8CA;" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.MailReply}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Reply All">
<MenuItem.Icon>
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8C2;" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.MailReplyAll}" />
</MenuItem.Icon>
</MenuItem>
</ui:MenuFlyout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,56 @@ public partial class DropDownButtonPage : Page
public DropDownButtonPage()
{
InitializeComponent();
UpdateExampleCode();
}

#region Example Code

public void UpdateExampleCode()
{

Example1.Xaml = Example1Xaml;
Example2.Xaml = Example2Xaml;
}

public string Example1Xaml => $@"
<ui:DropDownButton Content=""Email"">
<ui:DropDownButton.Flyout>
<ui:MenuFlyout Placement=""Bottom"">
<MenuItem Header=""Send"" />
<MenuItem Header=""Reply"" />
<MenuItem Header=""Reply All"" />
</ui:MenuFlyout>
</ui:DropDownButton.Flyout>
</ui:DropDownButton>
";

public string Example2Xaml => $@"
<ui:DropDownButton AutomationProperties.Name=""Email"">
<ui:DropDownButton.Content>
<ui:FontIcon Icon=""{{x:Static ui:SegoeFluentIcons.Mail}}"" />
</ui:DropDownButton.Content>
<ui:DropDownButton.Flyout>
<ui:MenuFlyout Placement=""Bottom"">
<MenuItem Header=""Send"">
<MenuItem.Icon>
<ui:FontIcon Icon=""{{x:Static ui:SegoeFluentIcons.Send}}"" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header=""Reply"">
<MenuItem.Icon>
<ui:FontIcon Icon=""{{x:Static ui:SegoeFluentIcons.MailReply}}"" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header=""Reply All"">
<MenuItem.Icon>
<ui:FontIcon Icon=""{{x:Static ui:SegoeFluentIcons.MailReplyAll}}"" />
</MenuItem.Icon>
</MenuItem>
</ui:MenuFlyout>
</ui:DropDownButton.Flyout>
</ui:DropDownButton>
";

#endregion

}
Expand Down

0 comments on commit fca4f5b

Please sign in to comment.