void UntrackTarget(Page page) { if (page == null) { return; } if (page is FlyoutPage) { _flyoutDetails--; } if (page is Shell shell) { shell.Navigated -= OnShellNavigated; shell.Navigating -= OnShellNavigating; return; } ((ObservableCollection <TMenuItem>)GetMenuItems(page)).CollectionChanged -= OnCollectionChanged; page.Descendants().OfType <Page>().ForEach(UnregisterChildPage); page.DescendantAdded -= OnChildAdded; page.DescendantRemoved -= OnChildRemoved; page.PropertyChanged -= OnPropertyChanged; }
void TrackTarget(Page page) { if (page == null) { return; } if (page is FlyoutPage) { _flyoutDetails++; } ((ObservableCollection <TMenuItem>)GetMenuItems(page)).CollectionChanged += OnCollectionChanged; if (page is Shell shell) { shell.Navigated += OnShellNavigated; shell.Navigating += OnShellNavigating; if (shell.GetCurrentShellPage() is Page currentShellPage) { RegisterChildPage(currentShellPage); } return; } page.Descendants().OfType <Page>().ForEach(RegisterChildPage); page.DescendantAdded += OnChildAdded; page.DescendantRemoved += OnChildRemoved; page.PropertyChanged += OnPropertyChanged; }
void UntrackTarget(Page page) { if (page == null) { return; } if (page is FlyoutPage) { _flyoutDetails--; } ((ObservableCollection <ToolbarItem>)page.ToolbarItems).CollectionChanged -= OnCollectionChanged; page.Descendants().OfType <Page>().ForEach(UnregisterChildPage); page.DescendantAdded -= OnChildAdded; page.DescendantRemoved -= OnChildRemoved; page.PropertyChanged -= OnPropertyChanged; }