Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            StartButton.AddTarget(startTimeEntry, UIControlEvent.TouchUpInside);
            StopButton.AddTarget(stopTimeEntry, UIControlEvent.TouchUpInside);
            ShowAllTimeEntriesButton.AddTarget((s, e) => openApp(), UIControlEvent.TouchUpInside);

            tapGestureRecognizer = new UITapGestureRecognizer(openApp);

            SuggestionsTableView.RegisterNibForCellReuse(SuggestionTableViewCell.Nib, SuggestionTableViewCell.Identifier);

            var suggestions = SharedStorage.Instance.GetCurrentSuggestions();

            if (suggestions == null)
            {
                ExtensionContext?.SetWidgetLargestAvailableDisplayMode(NCWidgetDisplayMode.Compact);
                return;
            }

            suggestionsCount = suggestions.Count;
            SuggestionsTableViewHeightConstraint.Constant = 60 * suggestionsCount;
            dataSource                  = new SuggestionsDataSource();
            dataSource.Suggestions      = suggestions;
            dataSource.Callback         = continueSuggestion;
            SuggestionsTableView.Source = dataSource;
        }