kmarks2
kmarks2

Reputation: 4875

Making a WPF Windows completely resizable

I'm updating a WPF in a project. As I received it, here is how the base window is specified:

<Window x:Class="SomeProject.ButtonForm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SomeProject" 
        Title="ButtonForm" Height="647" Width="379" WindowStyle="None" ResizeMode="CanResizeWithGrip" 
        SnapsToDevicePixels="True" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
        SizeChanged="Resized" Closing="Window_Closing" AllowsTransparency="True" >

Some main things are that WindowStyle is None, ResizeMode is CanResizeWithGrip and AllowsTransparency is True.

What I would like to do is make this window resizable from all four edges without grips. Is there a way to do this directly in the markup? I've seen some projects that implement this, but they involve whole separate files and complicated code-behind. Certainly there is a simpler way.

Upvotes: 1

Views: 4690

Answers (2)

Daniel
Daniel

Reputation: 11054

Check out MahApps.Metro. It may not be exactly what you're looking for, but it'll give your application an updated look with the functionality you're looking for and takes almost no effort.

You may also want to check out this question for some more discussion about custom window chrome.

Upvotes: 2

Andra Ciorici
Andra Ciorici

Reputation: 301

You have to set ResizeMode to "CanResize" and AllowTransparency to "False" to be able to see the chrome to resize it.

Upvotes: 0

Related Questions