Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can create a ControlTemplate for the window. Here is a pretty basic example that has some controls and triggers. You can easily add more elements to make it fit your needs.</p> <pre><code> &lt;ControlTemplate x:Key="MyWindowTemplate" TargetType="{x:Type Window}"&gt; &lt;Border x:Name="WindowBorder" Style="{DynamicResource WindowBorderStyle}"&gt; &lt;Grid&gt; &lt;Border Margin="4,4,4,4" Padding="0,0,0,0" x:Name="MarginBorder"&gt; &lt;AdornerDecorator&gt; &lt;ContentPresenter/&gt; &lt;/AdornerDecorator&gt; &lt;/Border&gt; &lt;ResizeGrip Visibility="Collapsed" IsTabStop="false" HorizontalAlignment="Right" x:Name="WindowResizeGrip" VerticalAlignment="Bottom" /&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;ControlTemplate.Triggers&gt; &lt;MultiTrigger&gt; &lt;MultiTrigger.Conditions&gt; &lt;Condition Property="ResizeMode" Value="CanResizeWithGrip"/&gt; &lt;Condition Property="WindowState" Value="Normal"/&gt; &lt;/MultiTrigger.Conditions&gt; &lt;Setter Property="Visibility" TargetName="WindowResizeGrip" Value="Visible"/&gt; &lt;Setter Property="Margin" TargetName="MarginBorder" Value="4,4,4,20" /&gt; &lt;/MultiTrigger&gt; &lt;Trigger Property="WindowState" Value="Maximized"&gt; &lt;Setter Property="CornerRadius" TargetName="WindowBorder" Value="0,0,0,0"/&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; </code></pre> <p>You can use this ControlTemplate by setting the template property of the Window:</p> <pre><code> Template="{StaticResource MyWindowTemplate}" </code></pre> <p>You will want to use this in conjunction with a style like this:</p> <pre><code> &lt;Style x:Key="MyWindowStyle" TargetType="{x:Type Window}"&gt; &lt;Setter Property="AllowsTransparency" Value="False" /&gt; &lt;Setter Property="WindowStyle" Value="SingleBorderWindow" /&gt; &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/&gt; &lt;Setter Property="Background" Value="Transparent" /&gt; &lt;Setter Property="ShowInTaskbar" Value="False" /&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type Window}"&gt; &lt;Border&gt; &lt;AdornerDecorator&gt; &lt;ContentPresenter/&gt; &lt;/AdornerDecorator&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>And set the style on your Window like this:</p> <pre><code>Style="{StaticResource MyWindowStyle}" </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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.
    3. 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