public async override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            var refreshControl = new MvxUIRefreshControl();

            this.RefreshControl = refreshControl;
            var source = new MeetingsViewSource(TableView);

            TableView.Source = source;

            var set = this.CreateBindingSet <MeetingsScreen, MeetingsViewModel>();

            set.Bind(source).To(vm => vm.Meetings);
            set.Bind(refreshControl).For(r => r.Message).To(vm => vm.LastUpdate);
            set.Bind(refreshControl).For(r => r.RefreshCommand).To(vm => vm.RefreshCommand);
            set.Bind(refreshControl).For(r => r.IsRefreshing).To(vm => vm.IsBusy);

            set.Apply();

            await ViewModel.InitializeAsync();

            // Load data
            TableView.ReloadData();
        }
예제 #2
0
        /*
         * private ToastView _toastView;
         *
         *      public ToastView ToastView
         *      {
         *  get{
         *
         *      if (_toastView == null)
         *      {
         *          _toastView = new ToastView();
         *      }
         *
         *      return _toastView;
         *  }
         *      }*/

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

            //ToastView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, 20);
            //TableView.TableHeaderView = ToastView;
            var refreshControl = new BindableUIRefreshControl();

            RefreshControl = refreshControl;
            var source = new MeetingsViewSource(TableView, ViewModel.Meetings);

            TableView.Source = source;
            refreshControl.RefreshCommand = ViewModel.RefreshCommand;
            refreshControl.Message        = ViewModel.LastUpdate;
            refreshControl.IsRefreshing   = ViewModel.IsBusy;

            // Load data
            TableView.ReloadData();
        }