示例#1
0
 void HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName.Equals("IsLoading"))
     {
         if (this.ViewModel.IsLoading && loadingView == null)
         {
             this.InvokeOnMainThread(() => {
                 loadingView = new LoadingHUDView("Loading...", "");
                 this.TableView.AddSubview(loadingView);
                 loadingView.StartAnimating();
             });
         }
         else if (!this.ViewModel.IsLoading && this.loadingView != null)
         {
             this.InvokeOnMainThread(() => {
                 loadingView.StopAnimating();
                 loadingView.RemoveFromSuperview();
                 loadingView = null;
             });
         }
     }
     else if (e.PropertyName.Equals("Lists"))
     {
         this.BeginInvokeOnMainThread(() => this.TableView.ReloadData());
     }
 }
示例#2
0
        void handlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName.Equals("IsLoading"))
            {
                if (ViewModel.IsLoading && _loadingView == null)
                {
                    InvokeOnMainThread(() =>
                    {
                        _loadingView = new LoadingHUDView("Loading...", "");
                        View.AddSubview(_loadingView);
                        _loadingView.StartAnimating();
                    });
                }
                else if (!ViewModel.IsLoading && _loadingView != null)
                {
                    InvokeOnMainThread(() =>
                    {
                        _loadingView.StopAnimating();
                        _loadingView.RemoveFromSuperview();
                        _loadingView = null;
                    });
                }
            }

            HandlePropertyChanged(e);
        }
示例#3
0
        void HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName.Equals("IsLoading"))
            {
                if (this.ViewModel.IsLoading && loadingView == null)
                {
                    this.InvokeOnMainThread(() => {
                        loadingView = new LoadingHUDView("Loading...", "");
                        this.TableView.AddSubview(loadingView);
                        loadingView.StartAnimating();
                    });
                }
                else if (!this.ViewModel.IsLoading && this.loadingView != null)
                {
                    this.InvokeOnMainThread(() => {
                        loadingView.StopAnimating();
                        loadingView.RemoveFromSuperview();
                        loadingView = null;
                    });
                }
            }
            else if (e.PropertyName.Equals("HasImage"))
            {
                if (this.ViewModel.HasImage)
                {
                    this.BeginInvokeOnMainThread(() =>
                    {
                        var converter = new Base64ToUIImageConverter();
                        var img       = (UIImage)converter.Convert(this.ViewModel.EntryImage.ImageBase64, typeof(UIImage), null, null);

                        this.Root [5].Clear();
                        this.Root [5].Add(elemRemPhoto);
                        this.Root [5].Add(new LargeImageElement()
                        {
                            Image = img
                        });
                        this.TableView.ReloadData();
                    });
                }
                else
                {
                    this.BeginInvokeOnMainThread(() =>
                    {
                        this.Root [5].Clear();
                        this.Root [5].Add(elemTakePhoto);
                        this.Root [5].Add(elemPickPhoto);
                        this.TableView.ReloadData();
                    });
                }
            }
        }