【发布时间】:2022-01-20 16:15:47
【问题描述】:
我有一个需要动态绑定到 Xamarin 页面的图标列表。
Xaml 是:
<Label
Grid.Row="2"
Grid.ColumnSpan="4"
HorizontalOptions="Start"
Style="{StaticResource IconLabelStyle}"
Text="{Binding Features}"/>
其中 Features 是一个逗号分隔的 Fontawesome 图标列表。硬编码的十六进制值有效
 
Unicode 值只是呈现为
"\uf236 \uf1eb"
如何获取要呈现为完整列表的图标列表?
好吧,这真的很奇怪。
这行得通
string features = "\uf236 \uf1eb \uf540 \uf2e7 \uf2cc \uf084 \uf26c \uf001 \ue065 \uf206";
FeaturesList = features;
这不是
FeaturesList = model.Features;
其中Features list是页面上的绑定列表。 Model.features 包含与字符串特征完全相同的值。感谢大家的帮助
【问题讨论】:
-
Features中究竟包含什么?请举个具体的例子 -
字符串值“\uf0c2”
标签: c# xaml xamarin.forms data-binding font-awesome