/// <summary> /// Definition for the source table that backs the tableView /// </summary> public TableSource(SearchFamiliesViewController parent) { Parent = parent; // create a list for the cell heights, since they're variable CellHeights = new List <nfloat>( ); }
public void FamilyUpdated(Rock.Client.Family family) { // this is called when a page (likely the current family page) updates a family. // This lets us notify SearchFamilies and the HistoryBar. if (HistoryBar.TryUpdateHistoryItem(family) == false) { // it failed to update, so it's likely a new family. Add it to the history. HistoryBar.TryPushHistoryItem(family, PresentFamilyPage_Internal); } SearchFamiliesViewController.TryUpdateFamily(family); }
public override void ViewDidLoad() { base.ViewDidLoad(); // First setup the SpringboardReveal button, which rests in the upper left // of the MainNavigationUI. (We must do it here because the ContainerViewController's // NavBar is the active one.) NSString buttonLabel = new NSString(""); HomeButton = new UIButton(UIButtonType.System); HomeButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont("Bh", 36); HomeButton.SetTitle(buttonLabel.ToString( ), UIControlState.Normal); HomeButton.SetTitleColor(Theme.GetColor(Config.Instance.VisualSettings.TopHeaderTextColor), UIControlState.Normal); HomeButton.SetTitleColor(UIColor.DarkGray, UIControlState.Disabled); // determine its dimensions CGSize buttonSize = buttonLabel.StringSize(HomeButton.Font); HomeButton.Bounds = new CGRect(0, 0, buttonSize.Width, buttonSize.Height); // set its callback HomeButton.TouchUpInside += (object sender, EventArgs e) => { // clear any current family VC CurrentFamilyInfoViewController = null; // reset our stack SubNavigationController.PopToRootViewController(true); SubNavigationController.View.SetNeedsLayout( ); // turn off the home button HomeButton.Enabled = false; // and enable the add family button AddFamilyButton.Enabled = true; }; // set the "Add Family" button buttonLabel = new NSString(""); AddFamilyButton = new UIButton(UIButtonType.System); AddFamilyButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont("Bh", 36); AddFamilyButton.SetTitle(buttonLabel.ToString( ), UIControlState.Normal); AddFamilyButton.SetTitleColor(Theme.GetColor(Config.Instance.VisualSettings.TopHeaderTextColor), UIControlState.Normal); AddFamilyButton.SetTitleColor(UIColor.DarkGray, UIControlState.Disabled); // determine its dimensions buttonSize = buttonLabel.StringSize(HomeButton.Font); AddFamilyButton.Bounds = new CGRect(0, 0, buttonSize.Width, buttonSize.Height); // set its callback AddFamilyButton.TouchUpInside += (object sender, EventArgs e) => { // clear any current family VC CurrentFamilyInfoViewController = null; // and present a new family page PresentNewFamilyPage( ); }; UIBarButtonItem[] leftItems = new UIBarButtonItem[] { new UIBarButtonItem(HomeButton), new UIBarButtonItem(AddFamilyButton) }; this.NavigationItem.SetLeftBarButtonItems(leftItems, false); CreateSubNavigationController( ); SearchFamiliesViewController = new SearchFamiliesViewController(this); SubNavigationController.PushViewController(SearchFamiliesViewController, true); HomeButton.Enabled = false; SettingsViewController = new SettingsViewController(this); // set our theme CoreViewController.ApplyTheme(this); }
public override void ViewDidLoad() { base.ViewDidLoad(); // First setup the SpringboardReveal button, which rests in the upper left // of the MainNavigationUI. (We must do it here because the ContainerViewController's // NavBar is the active one.) NSString buttonLabel = new NSString( "" ); HomeButton = new UIButton(UIButtonType.System); HomeButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont( "Bh", 36 ); HomeButton.SetTitle( buttonLabel.ToString( ), UIControlState.Normal ); HomeButton.SetTitleColor( Theme.GetColor( Config.Instance.VisualSettings.TopHeaderTextColor ), UIControlState.Normal ); HomeButton.SetTitleColor( UIColor.DarkGray, UIControlState.Disabled ); // determine its dimensions CGSize buttonSize = buttonLabel.StringSize( HomeButton.Font ); HomeButton.Bounds = new CGRect( 0, 0, buttonSize.Width, buttonSize.Height ); // set its callback HomeButton.TouchUpInside += (object sender, EventArgs e) => { // clear any current family VC CurrentFamilyInfoViewController = null; // reset our stack SubNavigationController.PopToRootViewController( true ); SubNavigationController.View.SetNeedsLayout( ); // turn off the home button HomeButton.Enabled = false; // and enable the add family button AddFamilyButton.Enabled = true; }; // set the "Add Family" button buttonLabel = new NSString( "" ); AddFamilyButton = new UIButton(UIButtonType.System); AddFamilyButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont( "Bh", 36 ); AddFamilyButton.SetTitle( buttonLabel.ToString( ), UIControlState.Normal ); AddFamilyButton.SetTitleColor( Theme.GetColor( Config.Instance.VisualSettings.TopHeaderTextColor ), UIControlState.Normal ); AddFamilyButton.SetTitleColor( UIColor.DarkGray, UIControlState.Disabled ); // determine its dimensions buttonSize = buttonLabel.StringSize( HomeButton.Font ); AddFamilyButton.Bounds = new CGRect( 0, 0, buttonSize.Width, buttonSize.Height ); // set its callback AddFamilyButton.TouchUpInside += (object sender, EventArgs e) => { // clear any current family VC CurrentFamilyInfoViewController = null; // and present a new family page PresentNewFamilyPage( ); }; UIBarButtonItem[] leftItems = new UIBarButtonItem[] { new UIBarButtonItem( HomeButton ), new UIBarButtonItem( AddFamilyButton ) }; this.NavigationItem.SetLeftBarButtonItems( leftItems, false ); CreateSubNavigationController( ); SearchFamiliesViewController = new SearchFamiliesViewController( this ); SubNavigationController.PushViewController( SearchFamiliesViewController, true ); HomeButton.Enabled = false; SettingsViewController = new SettingsViewController( this ); // set our theme CoreViewController.ApplyTheme( this ); }
/// <summary> /// Definition for the source table that backs the tableView /// </summary> public TableSource( SearchFamiliesViewController parent ) { Parent = parent; // create a list for the cell heights, since they're variable CellHeights = new List<nfloat>( ); }