I am currently creating a wpf application and want to disable window resizing during certain operations. I used this.ResizeMode = System.Windows.ResizeMode.CanMinimize; which does exactly what I want, but makes the window bigger than before.
I do not know if this is possible, but is there a way to avoid enlarging the window?
EDIT:
Here's a very simple wpf application demonstrating this problem.
XAML:
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <Button Content="Trigger CanMinimize" Height="23" HorizontalAlignment="Left" Margin="62,248,0,0" Name="canMin" VerticalAlignment="Top" Width="120" Click="canMin_Click" /> <Button Content="Trigger CanResize" Height="23" HorizontalAlignment="Left" Margin="327,248,0,0" Name="canRes" VerticalAlignment="Top" Width="108" Click="canRes_Click" /> </Grid> </Window>
cs file:
using System.Windows; namespace WpfApplication1 {
source share