public override void ViewDidLoad() { base.ViewDidLoad(); viewModel = new MasterViewModel(); viewModel.PropertyChanged += PropertyChanged; this.TableView.WeakDataSource = this; this.TableView.WeakDelegate = this; NavigationController.NavigationBar.BarStyle = UIBarStyle.Black; activityIndicator = new UIActivityIndicatorView(new System.Drawing.RectangleF(0, 0, 20, 20)); activityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; activityIndicator.HidesWhenStopped = true; NavigationItem.RightBarButtonItem = new UIBarButtonItem(activityIndicator); //Setup refresh control this.RefreshControl = new UIRefreshControl(); RefreshControl.ValueChanged += async (sender, args) => { if (viewModel.IsBusy) return; await LoadArticles(); }; LoadArticles(); }
protected async override void OnCreate(Bundle bundle) { CrossPlatformMessage.Instance = new Message(); base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Master); viewModel = new MasterViewModel(); AndHUD.Shared.Show(this, "Loading..."); await viewModel.ExecuteLoadItemsCommand(); ListAdapter = new FeedItemAdapter(this, viewModel.FeedItems); AndHUD.Shared.Dismiss(this); }
protected async override void OnCreate(Bundle bundle) { CrossPlatformMessage.Instance = new Message(); base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Master); var progress = FindViewById<ProgressBar> (Resource.Id.progressBar); viewModel = new MasterViewModel(); progress.Visibility = ViewStates.Visible; await viewModel.ExecuteLoadItemsCommand(); ListAdapter = new FeedItemAdapter(this, viewModel.FeedItems); progress.Visibility = ViewStates.Gone; }
public MasterViewController() { viewModel = new MasterViewModel(); this.Title = "Planet Xamarin"; }