MenuFlyoutItem中的[UWP]图标 [英] [UWP]Icon in MenuFlyoutItem
本文介绍了MenuFlyoutItem中的[UWP]图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在
官方微软文件 表示MenuFlyoutItem有一个Icon属性,但不幸的是,当我尝试添加这个时,Visual Studio给了我一个错误:
成员"图标"无法识别或无法访问。
在'MenuFlyoutItem'类型中找不到属性'Icon'。
但我迫切需要IconFlyoutItem的Icon。那我该怎么办?
谢谢!
解决方案
您好,
请您仔细检查您用于哪种应用程序模板?
我已尝试使用Blank UWP项目的以下代码并且没有错误:
MenuFlyoutItem menuFlyoutItem = new MenuFlyoutItem();
IconElement iconElement = new BitmapIcon();
menuFlyoutItem.Icon = iconElement;
希望这对您有所帮助。
In the official Microsoft documents said that there is an Icon property to MenuFlyoutItem, but unfortunately Visual Studio gives me an error when I try to add this:
The member "Icon" is not recognized or is not accessible. The property 'Icon' was not found in type 'MenuFlyoutItem'.
But I desperately need Icon for my MenuFlyoutItem. So what do I do?
Thanks!
解决方案
Hi,
Would you please double check what kind of application template you used for?
I've tried the following code with Blank UWP project and with no error:
MenuFlyoutItem menuFlyoutItem = new MenuFlyoutItem(); IconElement iconElement = new BitmapIcon(); menuFlyoutItem.Icon = iconElement;Hope this will be helpful to you.
这篇关于MenuFlyoutItem中的[UWP]图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文