Search code examples
xamarinxamarin.iosxamarin.androidxamarin.formsxamarin-studio

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


It is possible to add multiple Bindings to a Label using XAML, for example:

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

Solution

  • No, this is not possible.

    But why not concatenate it in your ViewModel and bind to that?

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

    And bind it like: <Label Text = "{Binding Description}" TextColor = "# ffeece" />