title: Show secondary window center of main window in UWP
body: <p>I started using multiple windows in UWP and need to display secondary windows center of screen or at least center of parent window.</p>
  
  <p>I found nothing relevant about how to specify where to show additional windows on the screen, other than <code>Window.Current.Bounds</code> property.</p>
  
  <p>Here is the simplified version of the method that I am using to create additional windows. The method signature is: <code>CreateFrameWindow(Size size, Type pageType, object parameter)</code></p>
  
  <pre><code>CoreApplicationView newWindow = CoreApplication.CreateNewView();
  
  ApplicationView newView = null;
  bool result = await newWindow.Dispatcher.TryRunAsync(CoreDispatcherPriority.Normal, () =&gt;
  {
      Frame frame = new Frame();
      frame.Navigate(pageType, parameter);
      Window.Current.Content = frame;
  
      Window.Current.Activate();
      newView = ApplicationView.GetForCurrentView();
  });
  
  result = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newView.Id);
  newView.TryResizeView(size);
  </code></pre>
  
  <p>The <code>TryResizeView</code> works fine as long as the secondary window has enough space to resize based on its current location on the screen. I want to enable resize up to the maximum available size (size of window when it is maximized) and place it to the center of the screen. If this is not possible, placing to the center of the parent or main window is acceptable.</p>