/// <summary> /// Switches the window associated with the selected item. /// </summary> private void Switch() { if (lb.Items.Count > 0) { AppWindow win = (AppWindow)lb.SelectedItem ?? (AppWindow)lb.Items[0]; win.SwitchTo(); } Hide(); }
private void CloseWindow(object sender, ExecutedRoutedEventArgs e) { if (lb.Items.Count > 0) { Hide(); AppWindow win = (AppWindow)lb.SelectedItem; win.PostClose(); win.SwitchTo(); } else { Hide(); } e.Handled = true; }