void TabHeader_CloseClicked(TabHeader header) { CloseTab(header.Text, header.Tag); }
void TabHeader_Clicked(TabHeader header) { SelectTab(header.Text, header.Tag); }
private bool CheckCancel(TabHeader header) { bool result = false; if (header.Page != null && header.Page.PageContent != null) { result = !header.Page.PageContent.Closing(); } return result; }
public void SelectTab(TabHeader header) { // Unselect other tabs foreach (var oheader in TabHeaders) if (oheader != header) oheader.IsSelected = false; header.IsSelected = true; // Fade in if not previously set if (CurrentPage == null) AnimateTabPageOpen(); CurrentPage = header.Page; SelectedTab = header; }
public int FindTabIndex(TabHeader header) { int index = TabHeaders.ToList().FindIndex(x => x.Text == header.Text); return index; }
public void AddTab(IPage page, string name = null, ImageSource image = null, string tag = null) { string txt = page.Title; ImageSource img = null; if (page.Image != null) img = new BitmapImage(page.Image); if (name != null) txt = name; if (image != null) img = image; TabHeader header = FindTab(page, txt, tag); if (header == null) { header = new TabHeader(); header.Text = txt; header.Image = img; header.Tag = tag; header.Page = new TabPage(page); header.Clicked += TabHeader_Clicked; header.CloseClicked += TabHeader_CloseClicked; header.Opened += TabHeader_Opened; header.Closed += TabHeader_Closed; page.SendData += SendEventData; // Send Current User Data SendCurrentUser(page); // Send Current Device List SendCurrentDevices(page); TabHeaders.Add(header); header.Open(TabHeaders.Count == 1); } SelectTab(header); }