protected virtual void OnTabSelected(object sender, UserTabSelectedEventArgs eventArgs) { if (sender == this || LastTab?.Item2 == eventArgs.SelectedTab) { LastTab = new Tuple <UserSection, UserTab>(CurrentSection, eventArgs.SelectedTab); return; } if (LastTab != null) { var tabEventArgs = new UserTabSelectedEventArgs(LastTab.Item2, GetTabChangeType(eventArgs.ChangeType)); TabChangedEvents.Push(new Tuple <UserSection, UserTabSelectedEventArgs>(LastTab.Item1, tabEventArgs)); } LastTab = new Tuple <UserSection, UserTab>(CurrentSection, eventArgs.SelectedTab); }
protected virtual void OnBackButton() { BackButton.Register(OnBackButton); if (TabChangedEvents.Count == 0) { return; } var tabChangedEvent = TabChangedEvents.Pop(); if (tabChangedEvent.Item1 == CurrentSection) { TabSelector.Select(this, tabChangedEvent.Item2); return; } tabChangedEvent.Item1.Data.SetCurrentTab(tabChangedEvent.Item2.SelectedTab.Data); SectionSelector.Select(this, new UserSectionSelectedEventArgs(tabChangedEvent.Item1, tabChangedEvent.Item2.ChangeType)); }