コード例 #1
0
        public override void ViewDidLoad()
        {
            View = new UIView()
            {
                BackgroundColor = UIColor.White
            };
            base.ViewDidLoad();

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

            _bindableProgress = new BindableProgress(View);

            var button = new UIButton(UIButtonType.RoundedRect);

            button.Frame = new  RectangleF(10, 10, 300, 40);
            button.SetTitle("Fetch", UIControlState.Normal);
            Add(button);
            var textField = new UITextField(new RectangleF(10, 50, 300, 40));

            Add(textField);

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

            set.Bind(button).To(vm => vm.FetchCommand);
            set.Bind(textField).To(vm => vm.IsBusy);
            set.Bind(_bindableProgress).For(b => b.Visible).To(vm => vm.IsBusy);
            set.Apply();
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            View = new UIView(){ BackgroundColor = UIColor.White};
            base.ViewDidLoad();

            _bindableProgress = new BindableProgress(View);

            var button = new UIButton(UIButtonType.RoundedRect);
            button.Frame = new  RectangleF(10, 10, 300, 40);
            button.SetTitle("Fetch", UIControlState.Normal);
            Add(button);
            var textField = new UITextField(new RectangleF(10, 50, 300, 40));
            Add(textField);

            var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
            set.Bind(button).To(vm => vm.FetchCommand);
            set.Bind(textField).To(vm => vm.IsBusy);
            set.Bind(_bindableProgress).For(b => b.Visible).To(vm => vm.IsBusy);
            set.Apply();
        }