Not resizable main window

Oct 29, 2012 at 4:17 AM

Is it possible to make the Main Window Not resizable?

Thanks for your support.

Oct 29, 2012 at 9:27 AM

Yes, there's an property "Resizable" that you can set in code behind (e.g. the Constructor) in order to make the window not resizable.

Oct 29, 2012 at 4:57 PM

Thanks for your quick answer.

Anyways, if I set this property at markup level (XAML) it is ignored and if I do this programmatically (at constructor level), the app throws a TargetInvocationException .

This is the place where I put the line inside the constructor:




Resizeable = false; // Throws an exception


Any suggestions?

Thanks again...

Nov 1, 2012 at 4:12 PM

Hi Jsaer,

sorry for the late reply, but I wanted to be sure that the workaround works.

1.) You have to add an Loaded Event to your main window.


2.) You have to implement the OnLoaded Method at your code behind file.


        public MainWindow()


        public void OnLoaded(object sender, EventArgs args)
            Resizeable = false;


- Gerhard

Nov 8, 2012 at 6:07 PM

Thanks for your answer, this seems force the value properly now. However I have noticed something:

If you maximize and restore the window, where Resizeable is False, at some point the value is reset and the window becomes resizeable again.

I know I could work on this by hooking another event(s) , but this couldn't represent so much work . Do you agree with me?

Thanks again for your support.