I need the items in a ToogleMenuFlyout
occupy the full width
of the screen.
But I'm not solve the problem.
I'm trying to put the width
of my Grid (Grid Main page) but I do not get to do in code-behind.
I am applying a style to MenuFlyoutPresenterStyle
but also not to give.
my code is:
AppBarButton x:Name="FiltersPhone" Icon="Filter" Label="Names">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="0,4,0,0"/>
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<ToggleMenuFlyoutItem x:Name="FlyoutItemDate" Text="Today" Tag="Date"
IsChecked="True/>
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
Apply the following should help [Updated to support landscape]:
Note that: this is still not a perfect solution to meet all your requirement. I am just trying to let you understand the MenuFlyoutPresenter's Maxwidth and the ToggleMenuFlyoutItem's width properties are the key to impelement what you want.
Set x:Name = "rootGrid" to page's root grid
In code-behind, implement the following:
Increase maxwidth of MenuFlyoutPresenter to larger one(like 1000)
Here is the result and I make the background to red to make it clear: