- (vm => vm.Name));
-Debug.WriteLine (label.Text); //prints "John Doe".
- ]]>
- ]]>
- (Label.TextProperty, vm => vm.Name, mode: BindingMode.OneWay);
-
-viewmodel.Name = "John Doe";
-Debug.WriteLine (label.Text); //prints ""
-label.Text = "Foo";
-Debug.WriteLine (viewmodel.Name); //prints "John Doe"
-
-
-//BindingMode.TwoWay
-label = new Label ();
-label.BindingContext = viewmodel = new PersonViewModel ();
-label.SetBinding (Label.TextProperty, vm => vm.Name, mode: BindingMode.TwoWay);
-
-viewmodel.Name = "John Doe";
-Debug.WriteLine (label.Text); //prints "John Doe"
-label.Text = "Foo";
-Debug.WriteLine (viewmodel.Name); //prints "Foo"
-
-
-//BindingMode.OneWayToSource
-label = new Label ();
-label.BindingContext = viewmodel = new PersonViewModel ();
-label.SetBinding (Label.TextProperty, vm => vm.Name, mode: BindingMode.OneWayToSource);
-
-viewmodel.Name = "John Doe";
-Debug.WriteLine (label.Text); //prints ""
-label.Text = "Foo";
-Debug.WriteLine (viewmodel.Name); //prints "Foo"
- ]]>
- Debug.WriteLine ("Command executed"));
-var button = new Button {
- Text = "Hit me to execute the command",
- Command = command,
-};
-]]>
- Debug.WriteLine ("Command executed: {0}", o));
-var button = new Button {
- Text = "Hit me to execute the command",
- Command = command,
- CommandParameter = "button0",
-};
-]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-{
- protected override void Invoke(Entry sender)
- {
- Color[] color ={ Color.Red,
- Color.Orange,
- Color.Yellow,
- Color.Green,
- Color.Blue,
- Color.Indigo,
- Color.Violet };
- sender.TextColor = color[sender.Text.Length % color.Length];
- }
-}]]>
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-]]>
- Developers should be aware that implicit styles are only applied to the specific type that is described by
-
-
-
-
-
-]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-{
- protected override void Invoke(Entry sender)
- {
- sender.TextColor = Color.Red;
- }
-}]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-