/// <summary> /// Navigate collection page. /// </summary> private void BtnCollection_Click(object sender, RoutedEventArgs e) { var btn = (ToggleButton)sender; var colId = (string)btn.Tag; if (MainFrame.Content?.GetType() != typeof(CollectionPage)) { MainFrame.Navigate(new CollectionPage(this, DbOperator.GetCollectionById(colId))); } if (MainFrame.Content?.GetType() == typeof(CollectionPage)) { var sb = (CollectionPage)MainFrame.Content; if (sb.Id != colId) { MainFrame.Navigate(new CollectionPage(this, DbOperator.GetCollectionById(colId))); } } }