Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara authored Dec 7, 2023
1 parent f82124d commit e0f535e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
38 changes: 37 additions & 1 deletion test/ModernWpfTestApp/MenuFlyoutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,26 @@
mc:Ignorable="d">

<Grid Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" Margin="12">
<StackPanel>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<StackPanel Grid.RowSpan="2">
<ButtonEx Content="Short Text MenuFlyout" x:Name="TestMenuFlyoutButton" AutomationProperties.Name="TestMenuFlyoutButton" Margin="0,0,0,12">
<ButtonEx.Flyout>
<MenuFlyout>
<MenuFlyoutItem Text="Reset" x:Name="TestMenuFlyoutItem" AutomationProperties.Name="TestMenuFlyoutItem" Click="TestMenuFlyoutItemClick"/>
<MenuFlyoutSeparator />
<MenuFlyoutItem Text="Repeat" />
<MenuFlyoutItem Text="Shuffle" />
</MenuFlyout>
</ButtonEx.Flyout>
</ButtonEx>

<Button Content="MenuFlyout" VerticalAlignment="Top">
<muxc:FlyoutService.Flyout>
<muxc:MenuFlyout>
Expand Down Expand Up @@ -102,5 +121,22 @@
</muxc:FlyoutService.Flyout>
</Button>
</StackPanel>

<Grid Grid.Column="1" Margin="20,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<TextBlock Text="MenuFlyoutItem height: "/>
<TextBlock x:Name="TestMenuFlyoutItemHeightTextBlock" AutomationProperties.Name="TestMenuFlyoutItemHeightTextBlock" Text="0" Grid.Column="1" Margin="5, 0, 0, 0"/>

<TextBlock Text="MenuFlyoutItem width: " Grid.Row="1"/>
<TextBlock x:Name="TestMenuFlyoutItemWidthTextBlock" AutomationProperties.Name="TestMenuFlyoutItemWidthTextBlock" Text="0" Grid.Row="1" Grid.Column="1" Margin="5, 0, 0, 0"/>
</Grid>
</Grid>
</local:TestPage>
6 changes: 6 additions & 0 deletions test/ModernWpfTestApp/MenuFlyoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ public MenuFlyoutPage()
{
InitializeComponent();
}

private void TestMenuFlyoutItemClick(object sender, object e)
{
TestMenuFlyoutItemHeightTextBlock.Text = $"{TestMenuFlyoutItem.ActualHeight}";
TestMenuFlyoutItemWidthTextBlock.Text = $"{TestMenuFlyoutItem.ActualWidth}";
}
}
}

0 comments on commit e0f535e

Please sign in to comment.