Beispiel #1
0
        private void OpenNewDisplay(PersonViewModel current)
        {
            var personView = new PersonView();

            personView.Frame       = new RectangleF(_offsetX, _offsetY, 320, 900);
            personView.DataContext = current;
            Add(personView);

            _offsetX += 40;
            _offsetY += 40;
        }
        public override void ViewDidLoad()
        {
            View = new UIView(){ BackgroundColor = UIColor.White};
            base.ViewDidLoad();

            var table = new UITableView(new RectangleF(0, 0, 320, 720));
            Add(table);

            var source = new MvxStandardTableViewSource(table, "TitleText FirstName");
            table.Source = source;

            var currentPersonView = new PersonView();
            currentPersonView.Frame = new RectangleF(320, 10, 320, 900);
            Add(currentPersonView);

            var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
            set.Bind(source).To(vm => vm.People);
            set.Bind(source).For(s => s.SelectedItem).To(vm => vm.Current);
            set.Bind(currentPersonView).For(s => s.DataContext).To(vm => vm.Current);
            set.Apply();

            FirstViewModel.WeakSubscribe(ViewModelPropertyChanged);
        }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            View = new UIView()
            {
                BackgroundColor = UIColor.White
            };
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }

            var table = new UITableView(new RectangleF(0, 0, 320, 720));

            Add(table);

            var source = new MvxStandardTableViewSource(table, "TitleText FirstName");

            table.Source = source;

            var currentPersonView = new PersonView();

            currentPersonView.Frame = new RectangleF(320, 10, 320, 900);
            Add(currentPersonView);

            var set = this.CreateBindingSet <FirstView, Core.ViewModels.FirstViewModel>();

            set.Bind(source).To(vm => vm.People);
            set.Bind(source).For(s => s.SelectedItem).To(vm => vm.Current);
            set.Bind(currentPersonView).For(s => s.DataContext).To(vm => vm.Current);
            set.Apply();

            FirstViewModel.WeakSubscribe(ViewModelPropertyChanged);
        }
        private void OpenNewDisplay(PersonViewModel current)
        {
            var personView = new PersonView();
            personView.Frame = new RectangleF(_offsetX, _offsetY, 320, 900);
            personView.DataContext = current;
            Add(personView);

            _offsetX += 40;
            _offsetY += 40;
        }