public override void ViewDidLoad() { base.ViewDidLoad (); _days = AppDelegate.ConferenceData.Days; UIImageView imageView = new UIImageView(UIImage.FromFile("Background.png")); imageView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); imageView.UserInteractionEnabled = true; // no XIB ! tableView = new UITableView() { Source = new TableViewSource(this, _days), AutoresizingMask = UIViewAutoresizing.FlexibleHeight| UIViewAutoresizing.FlexibleWidth, BackgroundColor = UIColor.Clear, Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height), }; // Set the table view to fit the width of the app. tableView.SizeToFit(); // Reposition and resize the receiver tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); // Add the table view as a subview this.View.AddSubview(tableView); imageView.AddSubview(tableView); this.View.AddSubview(imageView); }
/// <remarks> /// Background image idea from /// http://mikebluestein.wordpress.com/2009/10/05/setting-an-image-background-on-a-uitableview-using-monotouch/ /// </remarks> public override void ViewDidLoad() { base.ViewDidLoad (); Title = "Speakers"; //_speakerData = AppDelegate.ConferenceData.Speakers; speakerData = MonkeySpace.Core.ConferenceManager.Speakers.Values.ToList (); UIImageView imageView = new UIImageView (UIImage.FromFile ("Background.png")); imageView.Frame = new RectangleF (0, 0, View.Frame.Width, View.Frame.Height); imageView.UserInteractionEnabled = true; tableView = new UITableView { Source = new TableViewSource (this, speakerData) , AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth , BackgroundColor = UIColor.Clear , Frame = new RectangleF (0, 0, View.Frame.Width, View.Frame.Height - 44) , ShowsVerticalScrollIndicator = true}; imageView.AddSubview (tableView); View.AddSubview (imageView); // SLIDEOUT BUTTON NavigationController.NavigationBar.SetTitleTextAttributes(AppDelegate.Current.FontTitleTextAttributes); var bbi = new UIBarButtonItem(UIImage.FromBundle ("Images/slideout"), UIBarButtonItemStyle.Plain, (sender, e) => { AppDelegate.Current.FlyoutNavigation.ToggleMenu(); }); NavigationItem.SetLeftBarButtonItem (bbi, false); tableView.BackgroundView = new UIImageView (UIImage.FromBundle ("Images/Background")); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell (kCellIdentifier); if (cell == null) { cell = new UITableViewCell (UITableViewCellStyle.Default, kCellIdentifier); } cell.TextLabel.Text = _locations[indexPath.Row].Title; cell.Accessory = UITableViewCellAccessory.None; return cell; }
public override void ViewDidLoad() { base.ViewDidLoad (); UIImageView imageView = new UIImageView (UIImage.FromFile ("Background.png")); imageView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); imageView.UserInteractionEnabled = true; // no XIB ! tableView = new UITableView { Source = new TableViewSource (this, _date, _slots), AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth, BackgroundColor = UIColor.Clear, Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height - 100) }; imageView.AddSubview (tableView); this.View.AddSubview (imageView); }
/// <remarks> /// Background image idea from /// http://mikebluestein.wordpress.com/2009/10/05/setting-an-image-background-on-a-uitableview-using-monotouch/ /// </remarks> public override void ViewDidLoad() { base.ViewDidLoad (); //_speakerData = AppDelegate.ConferenceData.Speakers; speakerData = MonkeySpace.Core.ConferenceManager.Speakers.Values.ToList (); UIImageView imageView = new UIImageView (UIImage.FromFile ("Background.png")); imageView.Frame = new RectangleF (0, 0, View.Frame.Width, View.Frame.Height); imageView.UserInteractionEnabled = true; tableView = new UITableView { Source = new TableViewSource (this, speakerData) , AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth , BackgroundColor = UIColor.Clear , Frame = new RectangleF (0, 0, View.Frame.Width, View.Frame.Height - 93) , ShowsVerticalScrollIndicator = true}; imageView.AddSubview (tableView); View.AddSubview (imageView); }
public override void ViewDidLoad() { base.ViewDidLoad (); if (_timeslot > 0) { // filter by timeslot Sessions = AppDelegate.ConferenceData.Sessions.Take(4).ToList(); } else if (!String.IsNullOrEmpty(_tag)) { // filter by tag var x = from s in AppDelegate.ConferenceData.Sessions where s.HasTag(_tag) select s; Sessions = x.ToList(); } else { // just show all Sessions = AppDelegate.ConferenceData.Sessions; } FavoriteCodes = AppDelegate.UserData.GetFavoriteCodes(); UIImageView imageView = new UIImageView(UIImage.FromFile("Background.png")); imageView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); imageView.UserInteractionEnabled = true; // no XIB ! tableView = new UITableView() { Source = new TableViewSource(this), AutoresizingMask = UIViewAutoresizing.FlexibleHeight| UIViewAutoresizing.FlexibleWidth, BackgroundColor = UIColor.Clear, Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height-100) }; imageView.AddSubview(tableView); this.View.AddSubview(imageView); didViewDidLoadJustRun = true; }
public override int NumberOfSections(UITableView tableView) { return sectionTitles.Count; }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { MonkeySpace.Core.Speaker s = sectionElements[indexPath.Section][indexPath.Row]; if (bioVC == null) bioVC = new SpeakerBioViewController (s); else bioVC.Update (s); bioVC.Title = s.Name; svc.NavigationController.PushViewController (bioVC, true); tableView.DeselectRow (indexPath, true); }
public override int RowsInSection(UITableView tableview, int section) { return _locations.Count; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell (kCellIdentifier); if (cell == null) { cell = new UITableViewCell (UITableViewCellStyle.Default, kCellIdentifier); AppDelegate.GetCellSelectedColor (cell); } var s = sectionElements[indexPath.Section][indexPath.Row]; cell.TextLabel.Text = s.Name; return cell; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell (kCellIdentifier); if (cell == null) { cell = new UITableViewCell (UITableViewCellStyle.Default, kCellIdentifier); } string date = _dates[indexPath.Row].Date.ToString("dd-MMM dddd"); cell.TextLabel.Text = date; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return cell; }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { var loc = _locations[indexPath.Row]; Debug.WriteLine("RowSelected: Label=" + loc.Title); _dvc.FlipController.Flip(_locations[indexPath.Row]); tableView.DeselectRow(indexPath, true); }
public override void Selected(DialogViewController dvc, UITableView tableView, MonoTouch.Foundation.NSIndexPath path) { var svc = new SessionViewController (session); dvc.ActivateController (svc); }
public override void AccessoryButtonTapped(UITableView tableView, NSIndexPath indexPath) { var s = _slots[indexPath.Row]; SessionsViewController sessionsView = new SessionsViewController (); // TODO: timeslot sessionsView.Title = s.Title; _svc.NavigationController.PushViewController (sessionsView, true); }
public override NSIndexPath WillSelectRow(UITableView tableView, NSIndexPath indexPath) { var s = sectionElements[indexPath.Section][indexPath.Row]; if (String.IsNullOrEmpty (s.Bio) && s.Sessions.Count == 0) return null; else return indexPath; }
/// <summary> /// If there are subsections in the hierarchy, navigate to those /// ASSUMES there are _never_ Categories hanging off the root in the hierarchy /// </summary> public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { var s = _slots[indexPath.Row]; if (slotVC == null) slotVC = new TimeslotViewController (s); else slotVC.Update (s); slotVC.Title = s.Title; _svc.NavigationController.PushViewController (slotVC, true); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { MIX10Xml.Session s = _svc.Sessions[indexPath.Row]; if (sessVC == null) sessVC = new SessionViewController(s); else sessVC.Update(s); sessVC.Title = s.Title; _svc.NavigationController.PushViewController(sessVC, true); tableView.DeselectRow(indexPath,true); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { MIX10Xml.Session s = _svc.Sessions[indexPath.Row]; bool star = _svc.FavoriteCodes.Contains(s.Code); UITableViewCell cell = null; if (star) { cell = tableView.DequeueReusableCell ("star"); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, "star"); } cell.ImageView.Image = starImage; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; } else { cell = tableView.DequeueReusableCell ("plain"); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, "plain"); } cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; } try { cell.TextLabel.Text = s.Title; cell.DetailTextLabel.Text = s.GetSpeakerList(); } catch (Exception){} return cell; }
public UITableViewController() { TableView = new UITableView (() => Data); }
public override int RowsInSection(UITableView tableview, int section) { return sectionElements[section].Count; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell (kCellIdentifier); var s = _slots[indexPath.Row]; SessionCellController cellController = null; if (cell == null) { cellController = new SessionCellController (); NSBundle.MainBundle.LoadNib ("SessionCellController", cellController, null); cell = cellController.Cell; cell.Tag = Environment.TickCount; //HACK: fix this crappy hack controllers.Add (cell.Tag, cellController); } else { cellController = controllers[cell.Tag]; } if (s.Title == "Workshops" || s.Title == "Sessions") cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; else if (!String.IsNullOrEmpty (s.Brief)) cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; else cell.Accessory = UITableViewCellAccessory.None; try { Debug.WriteLine ("Original time: " + s.StartTime.ToString ()); Debug.WriteLine ("Universal time: " + s.StartTime.ToUniversalTime ().ToString ()); Debug.WriteLine ("Local time: " + s.StartTime.ToLocalTime ().ToString ()); cellController.SessionTitle = s.Title; cellController.Subtitle = ""; // TODO: chosen one? cellController.Time = s.StartTime.ToUniversalTime ().ToString ("HH:mm"); if (s.StartTime.ToUniversalTime () == s.EndTime.ToUniversalTime ()) cellController.EndTime = ""; else cellController.EndTime = s.EndTime.ToUniversalTime ().ToString ("HH:mm"); } catch (Exception) { } return cell; }
public override string[] SectionIndexTitles(UITableView tableView) { return sectionTitles.ToArray (); }
public override NSIndexPath WillSelectRow(UITableView tableView, NSIndexPath indexPath) { var s = _slots[indexPath.Row]; if (String.IsNullOrEmpty (s.Brief)) return null; return indexPath; }
public override UITableViewCell GetCell(UITableView tv) { var cell = tv.DequeueReusableCell (key); count++; if (cell == null) { cell = new SessionCell (UITableViewCellStyle.Subtitle, key, session, Caption, subtitle); } else ((SessionCell)cell).UpdateCell (session, Caption, subtitle); return cell; }
/// <summary> /// If there are subsections in the hierarchy, navigate to those /// ASSUMES there are _never_ Categories hanging off the root in the hierarchy /// </summary> public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { string date = _dates[indexPath.Row].Date.ToString("dd-MMM dddd"); DayViewController sessionsView = new DayViewController(_dates[indexPath.Row].Timeslots); sessionsView.Title = date; _dvc.NavigationController.PushViewController(sessionsView,true); tableView.DeselectRow(indexPath,true); }