SwitchTo() public method

Sets the focus to this window and brings it to the foreground.
public SwitchTo ( ) : void
return void
コード例 #1
0
 /// <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();
 }
コード例 #2
0
 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;
 }