是否可以使用 XAML 将多个绑定添加到标签?

use*_*802 4 xamarin.ios xamarin.android xamarin xamarin-studio xamarin.forms

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

<Label Text = "{Binding Address} - {Binding City} / {Binding State}" TextColor = "# ffeece" />
Run Code Online (Sandbox Code Playgroud)

Ger*_*uis 7

不,这是不可能的。

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

public string Description
{
    get { return $"{Address} - {City} / {State}"; }
}
Run Code Online (Sandbox Code Playgroud)

并将其绑定如下:<Label Text = "{Binding Description}" TextColor = "# ffeece" />