Beispiel #1
0
 void ReleaseDesignerOutlets()
 {
     if (FlowersTableView != null)
     {
         FlowersTableView.Dispose();
         FlowersTableView = null;
     }
     if (RefreshButton != null)
     {
         RefreshButton.Dispose();
         RefreshButton = null;
     }
 }
        public override void ViewDidLoad()
        {
            try
            {
                #region Hidden

                // See https://developer.xamarin.com/guides/android/advanced_topics/linking/#falseflag

                var falseFlag = false;

                // ReSharper disable once ConditionIsAlwaysTrueOrFalse
                if (falseFlag)
                // ReSharper disable HeuristicUnreachableCode
                {
                    RefreshButton.Clicked += (s, e) => { };
                }
                // ReSharper restore HeuristicUnreachableCode

                #endregion

                _bindings.Add(this.SetBinding(
                                  () => Vm.LastLoadedFormatted,
                                  () => LastLoadedText.Text));

                RefreshButton.SetCommand(Vm.RefreshCommand);

                _source = Vm.Flowers.GetTableViewSource(
                    BindFlowerCell,
                    ReuseId);

                FlowersTableView.RegisterClassForCellReuse(typeof(UITableViewCell), new NSString(ReuseId));
                FlowersTableView.Source = _source;

                _source.SelectionChanged +=
                    (s, e) => Vm.ShowDetailsCommand.Execute(_source.SelectedItem);

                base.ViewDidLoad();
            }
            catch (Exception ex)
            {
            }
        }