C#C
C#3y ago
42 replies
Turwaith

✅ WPF Window is too big when Height and Width are bound to a property

I have a simple WPF MVVM application where I want the code to be able to response to window size changes, so I bound Height and Width of the window to respective C# properties.

Now the designer shows the window in the correct size, but when I run the app, the window becomes a lot wider. The properties are never set except at their declaration. When I replace the height and width bindings with fixed values in the xaml, it works. How do I get this working using those bindings?
Was this page helpful?