Resize border NOT window in WPF
<p>This is my XAML:</p>

<pre><code>&lt;Window x:Class="IPCapture.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:IPCapture"
    mc:Ignorable="d"
    Title="IPCapture_GUI" Opacity="0.95" Background="Transparent" Foreground="White" FontFamily="Arial" FontSize="14" FontWeight="Bold" FontStretch="UltraExpanded" TextOptions.TextFormattingMode="Display" BorderThickness="0"
    Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Height="Auto" Width="Auto" Cursor="Arrow" WindowStyle="None" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" Topmost="True" ResizeMode="CanResizeWithGrip"&gt;
    &lt;Window.OpacityMask&gt;
        &lt;LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0"&gt;
            &lt;GradientStop Color="Black"/&gt;
            &lt;GradientStop Color="#B2420000" Offset="1"/&gt;
        &lt;/LinearGradientBrush&gt;
    &lt;/Window.OpacityMask&gt;
    &lt;Border CornerRadius="5" Background="#FFC20C0C" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" Height="Auto"&gt;
        &lt;Grid x:Name="GridMain" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0"&gt;
            &lt;Grid.RowDefinitions&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition x:Name="Keys" Width="Auto"/&gt;
                &lt;ColumnDefinition x:Name="Values" Width="Auto"/&gt;
            &lt;/Grid.ColumnDefinitions&gt;
        &lt;/Grid&gt;
        &lt;Border.Effect&gt;
            &lt;DropShadowEffect Opacity="0.6" BlurRadius="1"/&gt;
        &lt;/Border.Effect&gt;
    &lt;/Border&gt;
&lt;/Window&gt;
</code></pre>

<p>I followed many tutorials on how to achieve the GUI I wanted and I finally succeeded! However, it does not seem to provide the functionality that I need. I want to:</p>

<ul>
<li><strong>Resize</strong> the <strong>width</strong> of the GUI</li>
</ul>

<p>A visualisation of my problem:</p>

<p><a href="https://i.stack.imgur.com/W8fIJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W8fIJ.png" alt="WPF"></a></p>

<p>The large faded blue area is my <code>Window</code> and the small GUI in the top-left corner of that is my actual widget.<br><em>(That is enclosed in the <code>Border</code>)</em></p>

<p>As you can see from my code, I have set <code>ResizeMode="CanResizeWithGrip"</code> on the <code>Window</code>. I am able to resize the window perfectly fine <strong>BUT</strong> resizing it does not resize my actual GUI.<br><em>(Because of how my XAML is laid out)</em></p>

<p>So, for this reason, I want to somehow allow resize on the width of the border instead of the <code>Window</code>.</p>

<p>Additions: <em>(if possible)</em><br></p>

<ul>
<li>Is it possible to remove that small black toolbar that's centered on the top of the <code>Window</code>?</li>
<li>I am also confused as to why, because I have set <code>Height</code> and <code>Width</code> of the <code>Window</code> to <code>Auto</code>, is it so large? Shouldn't it only expand as large as it's content?</li>
</ul>