I have created a borderless application by making the main window invisible, then I created a border and adjusted the corner radius to make my application look appealing.
I have made the minimize/maximize/close buttons although when the application is maximized the border stays the same height and width. I would like it so the height and width would change when maximized or have the ability to be dragged wider etc.
I know the main window can be made resizeable either "CanResize" or "CanResizeWithGrip" however these functions are not available solely to the border.
Does anyone know how I am able to solve this? i.e. Make the border resizable?!
Any help is appreciated. Thanks.
Here is my XAML:
Title="TITLE" Height="400" Width="600" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" Icon="/TITLE;component/Images/TITLE1.png">
<Grid>
<Border BorderBrush="#50000000" BorderThickness="4" HorizontalAlignment="Left" Margin="12,12,0,0" Name="TITLEBorder" VerticalAlignment="Top" CornerRadius="100,40,100,40" MouseLeftButtonDown="TITLEBorder_MouseLeftButtonDown" MinWidth="554" MinHeight="337" MaxWidth="Infinity" MaxHeight="Infinity" >
<Border.Effect>
<DropShadowEffect x:Name="TITLEBorderShdw" BlurRadius="44" ShadowDepth="0" Color="Black"></DropShadowEffect>
</Border.Effect>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#8649E3BA" Offset="0" />
<GradientStop Color="#89FFFFFF" Offset="1" />
<GradientStop Color="#AF4CA2CC" Offset="0.639" />
</LinearGradientBrush>
</Border.Background>
<Grid>
<Button Name="CloseButton" Style="{StaticResource ResourceKey=CloseButton}" Height="20" Width="20" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20,4" Click="CloseButton_Click" />
<Button Name="MinimizeButton" Height="20" Width="20" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="64,4" Style="{StaticResource ResourceKey=MinimizeButton}" Click="MinimizeButton_Click" />
<Button Name="MaximizeButton" Style="{StaticResource ResourceKey=MaximizeButton}" Height="20" Width="20" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="42,4"
Click="MaximizeButton_Click" />
<Button Name="RestoreButton" Style="{StaticResource ResourceKey=RestoreButton}" Height="20" VerticalAlignment="Top" Margin="484,4,42,0" Click="RestoreButton_Click" />
</Grid>
</Border>
</Grid>
</Window>
Okay, I have made these improvements; I would now like it to be resizable? either by grip or this paragraph which was found using google, although it was not explained "You wil need to trace mouseEvents on your widget, change the cursor if the mouse in a specific corner.
Then catch mouse press events and resize your widget on mouse move events. ", Help/Explaination?
Title="TITLE" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" Icon="/TITLE;component/Images/TITLE1.png">
<Grid>
<Border BorderBrush="#50000000" BorderThickness="4" HorizontalAlignment="Right" Margin="12,12,0,0" Name="TITLEBorder" VerticalAlignment="Stretch" CornerRadius="100,40,100,40" MouseLeftButtonDown="TITLEBorder_MouseLeftButtonDown" Width="640" Height="360" >