FontIcon.Glyph 属性

定义

获取或设置标识图标标志符号的字符代码。

public:
 property Platform::String ^ Glyph { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Glyph();

void Glyph(winrt::hstring value);
public string Glyph { get; set; }
var string = fontIcon.glyph;
fontIcon.glyph = string;
Public Property Glyph As String
<FontIcon Glyph="characterCode"/>

属性值

String

Platform::String

winrt::hstring

图标字形的十六进制字符代码。

示例

var newAppBarButton = new AppBarButton();
var fontIcon = new FontIcon();
fontIcon.FontFamily = new FontFamily("Segoe MDL2 Assets");
fontIcon.Glyph = "\xE790";
newAppBarButton.Icon = fontIcon;
using namespace winrt::Windows::UI::Xaml;
...

auto newAppBarButton = Controls::AppBarButton{};
auto fontIcon = Controls::FontIcon{};
fontIcon.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
fontIcon.Glyph(L"\xE790");
newAppBarButton.Icon(fontIcon);

适用于