public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { // Show all of the cells if the user taps the "Show All..." row. if (IsTodayAvailable && !ShowingAll && indexPath.Row == TodayBaseRowCount) { ShowingAll = true; TableView.BeginUpdates(); NSIndexPath indexPathForRemoval = NSIndexPath.FromRowSection(TodayBaseRowCount, 0); TableView.DeleteRows(new NSIndexPath[] { indexPathForRemoval }, UITableViewRowAnimation.Fade); int count = Math.Max(List.Count - TodayBaseRowCount, 0); NSIndexPath[] inserted = new NSIndexPath[count]; for (int i = 0; i < count; i++) { inserted[i] = NSIndexPath.FromRowSection(i + TodayBaseRowCount, 0); } TableView.InsertRows(inserted, UITableViewRowAnimation.Fade); TableView.EndUpdates(); return; } // Open the main app if an item is tapped. NSUrl url = NSUrl.FromString("lister://today"); ExtensionContext.OpenUrl(url, null); }
public override void ViewDidLoad() { base.ViewDidLoad(); _webApi = new WebApi(); ExtensionContext.SetWidgetLargestAvailableDisplayMode(NCWidgetDisplayMode.Expanded); _tableView = new UITableView(View.Frame, UITableViewStyle.Plain); _tableView.AllowsSelection = false; _tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; _tableView.RowHeight = 52; _tableView.EstimatedRowHeight = 52; _source = new WidgetTableViewSource(); _tableView.Source = _source; _tapGesutre = new UITapGestureRecognizer((obj) => { ExtensionContext.OpenUrl(NSUrl.FromString("jp.kamusoft.sample://"), null); }); View.AddGestureRecognizer(_tapGesutre); View.AddSubview(_tableView); }
private void openApp() { ExtensionContext?.OpenUrl(new Uri(ApplicationUrls.Main.Default), null); }