wpfscreen-resolutionresolution-independence

Resolution independent or monitor size independent WPF apps


How could I develop resolution-independent and monitor size independent WPF apps? Monitor size independent means here suppose I develop a WPF app on a 15-inch monitor and when I will view that app on a 17-inch monitor then often UI looks different so how could I get rid of this problem in WPF? Please guide in detail. Thanks.


Solution

  • What you are looking for is Liquid Layout in WPF.

    Avoid specifying explicit Width and Height for your elements and it should scale up to whatever screen resolution available.

    Of course, MinWidth, MaxWidth and MinHeight, MaxHeight are also useful in restricting the size.

    Reference: