英文:
How to set the height for menuFlyoutSubItem generated menuFlyout in uwp?
问题
如何设置UWP中MenuFlyoutSubItem的高度 -> MenuFlyout的高度?
示例图像如下,
英文:
How to set the height for the MenuFlyoutSubItem's -> MenuFlyout height in uwp?
Sample Image is attached below,
答案1
得分: 1
你可以查看MenuFlyout主题资源,在MenuFlyoutPresenter中只有MinHeight属性可用于修改高度,但这将应用于所有MenuFlyoutSubItem,无法为单个SubItem单独设置高度。
private void MenuFlyout_Opened(object sender, object e)
{
MenuFlyout menuFlyout = sender as MenuFlyout;
Style style = new Style { TargetType = typeof(MenuFlyoutPresenter) };
style.Setters.Add(new Setter(MinHeightProperty, "500"));
menuFlyout.MenuFlyoutPresenterStyle = style;
}
英文:
You can check MenuFlyout theme resources, there is only the property MinHeight in MenuFlyoutPresenter to modify the height, but this will apply to all MenuFlyoutSubItem, and the height cannot be set individually for one SubItem.
private void MenuFlyout_Opened(object sender, object e)
{
MenuFlyout menuFlyout = sender as MenuFlyout;
Style style = new Style { TargetType = typeof(MenuFlyoutPresenter) };
style.Setters.Add(new Setter(MinHeightProperty, "500"));
menuFlyout.MenuFlyoutPresenterStyle = style;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。



评论