I want to set menu flyout background either in c# or xaml.
<FlyoutBase.AttachedFlyout>
<MenuFlyout x:Name="Flyout">
<MenuFlyout.Items >
<MenuFlyoutItem Text="Add Expense" Click="AddExpense_Click"/>
<MenuFlyoutItem Text="Add Friends" Click="AddFriends_Click"/>
</MenuFlyout.Items>
</MenuFlyout>
</FlyoutBase.AttachedFlyout>
... And this is my xaml code for menu fly-out
我认为您必须更改FlyoutPresenterStyle。
For your requirement, you could custom MenuFlyoutPresenterStyle
like the following
<MenuFlyout x:Name="Flyout">
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Background" Value="Red"/>
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<MenuFlyout.Items >
<MenuFlyoutItem Text="Add Expense" />
<MenuFlyoutItem Text="Add Friends" />
</MenuFlyout.Items>
</MenuFlyout>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.