可以使用 XAML 向标签添加多个绑定吗?

It is possible to add multiple bindings to a Label using XAML?

可以使用 XAML 将多个绑定添加到标签,例如:

<Label Text = "{Binding Address} - {Binding City} / {Binding State}" TextColor = "# ffeece" />

不,这不可能。

但为什么不在您的 ViewModel 中连接它并绑定到它呢?

public string Description
{
    get { return $"{Address} - {City} / {State}"; }
}

并像这样绑定:<Label Text = "{Binding Description}" TextColor = "# ffeece" />

我不确定您是否可以将多个绑定添加到同一个 属性。但您可以像上面的答案一样使用或通过传递对象并返回格式化字符串来使用值转换器。

如果您想在 XAML 中的一个控件上绑定不同的属性,在这种情况下,您必须在视图模型中绑定属性,这样您就可以轻松绑定。你可以参考上面的例子。