Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>How about just simply maximising the <code>ChildWindow</code>? Behind your full screen <code>Button</code> you do,</p> <pre><code> private void FullScreenButton_Click(object sender, System.Windows.RoutedEventArgs e) { // get the explorer window size double height = App.Current.Host.Content.ActualHeight; double width = App.Current.Host.Content.ActualWidth; // need to make it a little bit smaller or it won't resize this.Height = height - 1; this.Width = width - 1; // need to update the layout here this.UpdateLayout(); // the following code repositions the child window var root = VisualTreeHelper.GetChild(this, 0) as FrameworkElement; if (root == null) { return; } var contentRoot = root.FindName("ContentRoot") as FrameworkElement; if (contentRoot == null) { return; } var group = contentRoot.RenderTransform as TransformGroup; if (group == null) { return; } TranslateTransform translateTransform = null; foreach (var transform in group.Children.OfType&lt;TranslateTransform&gt;()) { translateTransform = transform; } if (translateTransform == null) { return; } // reset transform translateTransform.X = 0.0; translateTransform.Y = 0.0; } </code></pre> <p><strong>UPDATE</strong></p> <p>In the <code>ChildWindow</code>'s default style, it has this <code>Grid</code> called <code>ContentRoot</code> which sets the position of the <code>ChildWindow</code> by <code>RenderTransform</code>. That's why you need to reset the <code>TranslateX</code> and <code>TranslateY</code> to make it top left.</p> <pre><code> &lt;Grid x:Name="ContentRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" RenderTransformOrigin="0.5,0.5" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}"&gt; &lt;Grid.RenderTransform&gt; &lt;TransformGroup&gt; &lt;ScaleTransform/&gt; &lt;SkewTransform/&gt; &lt;RotateTransform/&gt; &lt;TranslateTransform/&gt; &lt;/TransformGroup&gt; &lt;/Grid.RenderTransform&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload