public App() { _model = new PurePCLViewModel.ViewModel(); BindingContext = _model; var boundLabel = new Label { XAlign = TextAlignment.Center, Text = "" }; boundLabel.SetBinding(Label.TextProperty, new Binding("TheAnswer")); var button = new Button() { Text = "Test Realm", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; button.Clicked += (s, e) => { _model.TestRealm(); }; // The root page of your application MainPage = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { new Label { XAlign = TextAlignment.Center, Text = "Welcome to ThreeLayer PCL in Forms!" }, button, boundLabel } } }; }
public App() { _model = new PurePCLViewModel.ViewModel(); BindingContext = _model; var boundLabel = new Label { XAlign = TextAlignment.Center, Text = "" }; boundLabel.SetBinding(Label.TextProperty, new Binding("TheAnswer")); var button = new Button() { Text = "Test Realm", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; button.Clicked += (s, e) => { _model.TestRealm(); }; // The root page of your application MainPage = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { new Label { XAlign = TextAlignment.Center, Text = "Welcome to ThreeLayer PCL in Forms!" }, button, boundLabel } } }; }