Klaus Nji
Klaus Nji

Reputation: 18877

MvvmCross binding to multiple properties on android control using swiss syntax

What is the correct syntax for binding to multiple properties on an Android element?

I tried something like this local:MvxBind="{ Value StartTime, Text StartTimeText}"

where properties StartTime and StartTime text are defined in the ViewModel but this does not work. Value and Text are properties of this custom control.

The ViewModel may look like this:

public class ViewModel
{
   public DateTime StartTime{get;set;}
   public string StartTimeText {get;set;}
}

I found this related question, but cannot find the correct Swiss syntax for multiple bindings. Any one done multiple bindings on an element?

TIA.

Upvotes: 13

Views: 4163

Answers (1)

Klaus Nji
Klaus Nji

Reputation: 18877

Syntax I was looking for is:

local:MvxBind="Value StartTime; Text StartTimeText"

Don't forget the space after the ";". Without it you won't get the first binding.

Upvotes: 25

Related Questions