void SetComponents(MvxFluentBindingDescriptionSet <SimpleExampleView, SimpleExampleViewModel> Set, AutoLayoutContentView ComponentsBorder) { var button1 = ComponentsBorder.AddButton("Button1", "Scroll Example", UIColor.Green, UIColor.White, 12); ComponentsBorder.AddActivityIndicator("ActivityIndicator", UIColor.Blue); ComponentsBorder.AddPageControl("PageControl", UIColor.Blue); ComponentsBorder.AddProgressView("ProgressView", UIColor.Blue); ComponentsBorder.AddSlider("Slider", UIColor.Blue); ComponentsBorder.AddSwitch("Switch", UIColor.Blue); ComponentsBorder.AddSegmentedControl("SegmentedControl", UIColor.Blue); // We can add in other UIViews that don't have their own bespoke Add methods. var button2 = (UIButton)ComponentsBorder.AddView("Button2", UIButton.FromType(UIButtonType.RoundedRect)); button2.SetTitle("List Example", UIControlState.Normal); ComponentsBorder.AddConstraint("V:|-[Button1(20)]-[ActivityIndicator(60)]-[PageControl(50)]-[ProgressView(50)]-[Slider]-[Switch]-[SegmentedControl]-|"); ComponentsBorder.AddConstraint("V:|-[Button2(20)]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[Button1(<=100)]-[Button2(<=100)]-(>=8)-|"); // TODO: these controls still need some beautification and MVX binding. ComponentsBorder.AddConstraint("H:|-[ActivityIndicator(60)]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[PageControl(50)]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[ProgressView(50)]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[Slider(100)]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[Switch]-(>=8)-|"); ComponentsBorder.AddConstraint("H:|-[SegmentedControl]-(>=8)-|"); Set.Bind(button1).For("Tap").To(vm => vm.GotoScrollView).WithConversion("CommandParameter", "scrollView"); Set.Bind(button2).For("Tap").To(vm => vm.GotoListView).WithConversion("CommandParameter", "listView"); }
void SetComponents(MvxFluentBindingDescriptionSet<SimpleExampleView, SimpleExampleViewModel> Set, AutoLayoutContentView ComponentsBorder) { var button1 = ComponentsBorder.AddButton ("Button1", "Scroll Example", UIColor.Green, UIColor.White, 12); ComponentsBorder.AddActivityIndicator ("ActivityIndicator", UIColor.Blue); ComponentsBorder.AddPageControl ("PageControl", UIColor.Blue); ComponentsBorder.AddProgressView ("ProgressView", UIColor.Blue); ComponentsBorder.AddSlider ("Slider", UIColor.Blue); ComponentsBorder.AddSwitch ("Switch", UIColor.Blue); ComponentsBorder.AddSegmentedControl ("SegmentedControl", UIColor.Blue); // We can add in other UIViews that don't have their own bespoke Add methods. var button2 = (UIButton)ComponentsBorder.AddView ("Button2", UIButton.FromType (UIButtonType.RoundedRect)); button2.SetTitle ("List Example", UIControlState.Normal); ComponentsBorder.AddConstraint ("V:|-[Button1(20)]-[ActivityIndicator(60)]-[PageControl(50)]-[ProgressView(50)]-[Slider]-[Switch]-[SegmentedControl]-|"); ComponentsBorder.AddConstraint ("V:|-[Button2(20)]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[Button1(<=100)]-[Button2(<=100)]-(>=8)-|"); // TODO: these controls still need some beautification and MVX binding. ComponentsBorder.AddConstraint ("H:|-[ActivityIndicator(60)]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[PageControl(50)]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[ProgressView(50)]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[Slider(100)]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[Switch]-(>=8)-|"); ComponentsBorder.AddConstraint ("H:|-[SegmentedControl]-(>=8)-|"); Set.Bind (button1).For ("Tap").To (vm => vm.GotoScrollView).WithConversion ("CommandParameter", "scrollView"); Set.Bind (button2).For ("Tap").To (vm => vm.GotoListView).WithConversion ("CommandParameter", "listView"); }