public string TitleForHeader(MonoTouch.UIKit.UITableView tableView, int section) { switch (section) { case 0: return(@"New Center View"); case 1: return(@"Drawer Width"); case 2: return(@"Shadow"); case 3: return(@"Drawer Open Gestures"); case 4: return(@"Drawer Close Gestures"); case 5: return(@"Open Center Interaction Mode"); case 6: return(@"Strech Drawer"); default: return(null); } }
public float GetHeight(MonoTouch.UIKit.UITableView tableView, NSIndexPath indexPath) { var str = string.IsNullOrEmpty(_gist.Description) ? "No Description" : _gist.Description; var height = str.MonoStringHeight(UIFont.SystemFontOfSize(12f), tableView.Bounds.Width - (46 + 28)) - 15f; return(90f + height); }
void ReleaseDesignerOutlets() { if (tblProducts != null) { tblProducts.Dispose(); tblProducts = null; } }
public override void Selected(DialogViewController dvc, MonoTouch.UIKit.UITableView tableView, NSIndexPath path) { if (Tapped != null) { Tapped(); } tableView.DeselectRow(path, true); }
public override float GetHeightForFooter(MonoTouch.UIKit.UITableView tableView, int section) { if (tableView.Style == MonoTouch.UIKit.UITableViewStyle.Grouped) { return(2); } return(base.GetHeightForFooter(tableView, section)); }
public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv) { var cell = base.GetCell(tv); cell.TextLabel.Font = AppDelegate.Font; cell.TextLabel.TextColor = UIColor.Black; return(cell); }
protected override UITableViewCell GetCellImpl(MonoTouch.UIKit.UITableView tv) { var cell = base.GetCellImpl(tv); cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.BackgroundView = new UIView(RectangleF.Empty); return cell; }
public override void RowSelected(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { base.RowSelected(tableView, indexPath); var item = ItemAt(indexPath) as FeedbackItemViewModel; if (item != null) { item.GoToCommand.ExecuteIfCan(); } }
public override void AccessoryButtonTapped(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { CustomCell cell = tableView.CellAt(indexPath) as CustomCell; if (cell != null) { AppDelegate ad = (AppDelegate)UIApplication.SharedApplication.Delegate; ad.ShowDetail(cell); } }
public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv) { var factory = new AccountCellFactory() { ShowIndicator = _showIndicator }; var cell = factory.BuildCell(CellKey); cell.Update(_account); return(cell); }
public void DidSelectRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { switch (indexPath.Section) { case 1: case 3: MMExampleDrawerVisualStateManager sharedManager = new MMExampleDrawerVisualStateManager(); if (indexPath.Section == 1) { //sharedManager.LeftDrawerAnimationType = indexPath.Row; } else { //sharedManager.RightDrawerAnimationType = indexPath.Row; } //tableView.ReloadSections (indexPath.Section, UITableViewRowAnimation.None); tableView.SelectRow(indexPath, false, UITableViewScrollPosition.None); tableView.DeselectRow(indexPath, true); break; case 0: case 2: UIViewController sideDrawerViewController = MMDrawerController_UIViewController.Mm_drawerController.RightDrawerViewController; ; MMDrawerSide drawerSide = MMDrawerSide.None; if (indexPath.Section == 0) { drawerSide = MMDrawerSide.Left; } else if (indexPath.Section == 2) { sideDrawerViewController = MMDrawerController_UIViewController.Mm_drawerController.RightDrawerViewController; drawerSide = MMDrawerSide.Right; } if (sideDrawerViewController != null) { MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerAnimated(true, completion()); } else if (drawerSide == MMDrawerSide.Left) { UIViewController vc = new MMExampleLeftSideDrawerViewController(); UINavigationController navC = new MMNavigationController(vc); MMDrawerController_UIViewController.Mm_drawerController.RightDrawerViewController = navC; this.SetupRightButton(); } //tableView.ReloadRow (indexPath, UITableViewRowAnimation.None); tableView.SelectRow(indexPath, false, UITableViewScrollPosition.None); break; default: break; } }
public override void RowSelected(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { CustomCell cell = tableView.CellAt(indexPath) as CustomCell; if (cell != null) { cell.CheckButtonTouchDown(null, null); } tableView.DeselectRow(indexPath, true); }
public void RowSelected(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (indexPath.Section == 1) { MMDrawerController_UIViewController.Mm_drawerController.SetMaximumLeftDrawerWidth((float)this.DrawerWidths.ValueAt((uint)indexPath.Row).ToInt32(), true, null); } else { base.RowSelected(tableView, indexPath); } }
public string TitleForHeader(MonoTouch.UIKit.UITableView tableView, int section) { if (section == 1) { return("Right Drawer Width"); } else { return(base.TitleForHeader(tableView, section)); } }
public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv) { // try and dequeue a cell object to reuse. if one doesn't exist, create a new one UserGroupCell cell = tv.DequeueReusableCell(cellKey) as UserGroupCell; if (cell == null) { cell = new UI.CustomElements.UserGroupCell(usergroup); } cell.UpdateCell(usergroup); return(cell); }
public override float GetHeight(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { float margin = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 40f : 110f; SizeF size = new SizeF(tableView.Bounds.Width - margin, float.MaxValue); string c = Caption; // ensure the (single-line) Value will be rendered inside the cell if (String.IsNullOrEmpty(c) && !String.IsNullOrEmpty(Value)) { c = " "; } return(tableView.StringSize(c, _font, size, UILineBreakMode.WordWrap).Height + 10); }
public override MonoTouch.UIKit.UIView GetViewForHeader(MonoTouch.UIKit.UITableView tableView, int sectionIdx) { var view = base.GetViewForHeader(tableView, sectionIdx); foreach (var v in view.Subviews) { var label = v as UILabel; if (label != null) { label.LineBreakMode = UILineBreakMode.HeadTruncation; } } return(view); }
public override MonoTouch.UIKit.UITableViewCell GetCell(Cell item, MonoTouch.UIKit.UITableView tv) { AccessoryViewCell viewCell = item as AccessoryViewCell; var nativeCell = base.GetCell(item, tv); var frame = new RectangleF(0, 0, (float)viewCell.AccessoryView.WidthRequest, (float)viewCell.AccessoryView.HeightRequest); var nativeView = RendererFactory.GetRenderer(viewCell.AccessoryView).NativeView; nativeView.Frame = frame; nativeView.Bounds = frame; nativeCell.AccessoryView = nativeView; return(nativeCell); }
public float GetHeight(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (GetRootElement() == null) { return(44f); } var cell = GetRootElement().GetOffscreenCell(ShowcaseTableViewCell.Key, () => ShowcaseTableViewCell.Create()); cell.Description = _description; cell.Name = _name; cell.SetNeedsUpdateConstraints(); cell.UpdateConstraintsIfNeeded(); cell.Bounds = new RectangleF(0, 0, tableView.Bounds.Width, tableView.Bounds.Height); cell.SetNeedsLayout(); cell.LayoutIfNeeded(); return(cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize).Height + 1); }
public override float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (_usedForHeight == null) { _usedForHeight = (FeedbackCellView)tableView.DequeueReusableCell(FeedbackCellView.Key); } var item = ItemAt(indexPath) as FeedbackItemViewModel; if (item != null) { _usedForHeight.ViewModel = item; _usedForHeight.SetNeedsUpdateConstraints(); _usedForHeight.UpdateConstraintsIfNeeded(); _usedForHeight.Bounds = new System.Drawing.RectangleF(0, 0, tableView.Bounds.Width, tableView.Bounds.Height); _usedForHeight.SetNeedsLayout(); _usedForHeight.LayoutIfNeeded(); return(_usedForHeight.ContentView.SystemLayoutSizeFittingSize(MonoTouch.UIKit.UIView.UILayoutFittingCompressedSize).Height + 1); } return(base.GetHeightForRow(tableView, indexPath)); }
public int NumberOfSections(MonoTouch.UIKit.UITableView tableView) { // Return the number of sections. return(7); }
public float GetHeightForFooter(MonoTouch.UIKit.UITableView tableView, int section) { return(0.0F); }
public float GetHeightForHeader(MonoTouch.UIKit.UITableView tableView, int section) { return(56.0F); }
public FeedbackTableViewSource(MonoTouch.UIKit.UITableView tableView, IReactiveNotifyCollectionChanged <FeedbackItemViewModel> collection) : base(tableView, collection, FeedbackCellView.Key, 69.0f) { _tableView = tableView; tableView.RegisterNibForCellReuse(FeedbackCellView.Nib, FeedbackCellView.Key); }
public FeedbackTableViewSource(MonoTouch.UIKit.UITableView tableView) : base(tableView) { tableView.RegisterNibForCellReuse(FeedbackCellView.Nib, FeedbackCellView.Key); }
public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv) { var cell = tv.DequeueReusableCell(CellKey); if (cell == null) { if (_full) { cell = GistDetailViewCell.Create(); } else { cell = GistDetailViewCell.CreateNoBottom(); } cell.BackgroundView = new CellBackgroundView(); } cell.SelectionStyle = (Tapped != null) ? UITableViewCellSelectionStyle.Blue : UITableViewCellSelectionStyle.None; cell.Accessory = (Tapped != null) ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None; var gcell = cell as GistDetailViewCell; if (gcell == null) { return(cell); } var str = string.IsNullOrEmpty(_gist.Description) ? "No Description" : _gist.Description; //We prefer the filename, so lets try and get it if it exists string filename = null; if (_gist.Files.Count > 0) { var iter = _gist.Files.Keys.GetEnumerator(); iter.MoveNext(); filename = iter.Current; } //Set the name (If we have no filename, fall back to the username) var name = (filename == null) ? (_gist.User == null ? "Unknown" : _gist.User.Login) : filename; var imageUri = (_gist.User == null) ? null : new Uri(_gist.User.AvatarUrl); var img = ImageLoader.DefaultRequestImage(imageUri, this); if (img != null) { Image = img; } if (_full) { gcell.SetInformation(Image, name, _gist.CreatedAt.ToDaysAgo(), str, _gist.Forks.Count, _gist.Comments, 0); } else { gcell.SetInformation(Image, name, _gist.CreatedAt.ToDaysAgo(), str); } return(gcell); }
public float GetHeight(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { return(65f); }
public int NumberOfSections(MonoTouch.UIKit.UITableView tableView) { return(4); }
public void RowSelected(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { switch (indexPath.Section) { case 0: //MMDrawerSectionViewSelection MMExampleCenterTableViewController center = new MMExampleCenterTableViewController(); UINavigationController nav = new UINavigationController(center); if (indexPath.Row % 2 == 0) { MMDrawerController_UIViewController.Mm_drawerController.CenterViewController = nav; MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerAnimated(true, null); } else { MMDrawerController_UIViewController.Mm_drawerController.CenterViewController = nav; MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerAnimated(true, null); } break; case 1: //MMDrawerSectionDrawerWidth break; case 2: //MMDrawerSectionShadowToggle MMDrawerController_UIViewController.Mm_drawerController.ShowsShadow = MMDrawerController_UIViewController.Mm_drawerController.ShowsShadow; tableView.ReloadSections(NSIndexSet.FromIndex(indexPath.Section), UITableViewRowAnimation.None); break; case 3: //MMDrawerSectionOpenDrawerGestures switch (indexPath.Row) { case 0: MMDrawerController_UIViewController.Mm_drawerController.OpenDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningNavigationBar; break; case 1: MMDrawerController_UIViewController.Mm_drawerController.OpenDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView; break; case 2: MMDrawerController_UIViewController.Mm_drawerController.OpenDrawerGestureModeMask = MMOpenDrawerGestureMode.BezelPanningCenterView; break; default: break; } tableView.ReloadRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.None); break; case 4: //MMDrawerSectionCloseDrawerGestures switch (indexPath.Row) { case 0: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningNavigationBar; break; case 1: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView; break; case 2: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.BezelPanningCenterView; break; case 3: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.TapNavigationBar; break; case 4: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.TapCenterView; break; case 5: MMDrawerController_UIViewController.Mm_drawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningDrawerView; break; default: break; } tableView.ReloadRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.None); break; case 5: //MMDrawerSectionCenterHiddenInteraction tableView.ReloadRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.None); break; case 6: //MMDrawerSectionStretchDrawer MMDrawerController_UIViewController.Mm_drawerController.ShouldStretchDrawer = !MMDrawerController_UIViewController.Mm_drawerController.ShouldStretchDrawer; tableView.ReloadSections(NSIndexSet.FromIndex(indexPath.Section), UITableViewRowAnimation.None); break; default: break; } tableView.SelectRow(indexPath, false, UITableViewScrollPosition.None); tableView.DeselectRow(indexPath, true); }
public float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { return(40.0F); }