ApiExamples.Touch.Views.ListView.ViewDidLoad C# (CSharp) Method

ViewDidLoad() public method

public ViewDidLoad ( ) : void
return void
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var table = new UITableView(new CGRect(0, 130, 320, 300));
            Add(table);
            var source = new MvxStandardTableViewSource(table, "TitleText .");
            table.Source = source;

            var add = new UIButton(UIButtonType.RoundedRect);
            add.SetTitle("+", UIControlState.Normal);
            add.Frame = new CGRect(10, 100, 140, 30);
            Add(add);

            var remove = new UIButton(UIButtonType.RoundedRect);
            remove.SetTitle("-", UIControlState.Normal);
            remove.Frame = new CGRect(170, 100, 140, 30);
            Add(remove);

            var set = this.CreateBindingSet<ListView, ListViewModel>();
            set.Bind(source).To(vm => vm.Items);
            set.Bind(add).To(vm => vm.AddCommand);
            set.Bind(remove).To(vm => vm.RemoveCommand);
            set.Apply();
        }
ListView