how could i develop resolution independent and monitor size independent wpf apps. monitor size independent means here suppose i develop a wpf apps in 15inch monitor and when i will view that apps in 17 inch monitor then often UI looks different so how could i get rid of this problem in WPF. please guide in detail. thanks
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
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:
That's pretty complicated question. Basically, WPF was created to allow to create resolution independent application. For example, all values (width, height etc.) are in
Device Independent Pixels
, where each point is1/96
of an inch (which matches one pixel per point for monitor with DPI set to 96).But of course this will not let you create completely device independent applications. Here you need to remember to use appropriate layout mechanisms, like using
DockPanel
,StackPanel
orGrid
, and notCanvas
. Your controls should be set to fill all available space (HorizontalAlignment
set toStretch
), only some should haveWidth
orHeight
set explicitly.It's rather big topic, good practices, that will allow you to complete your goal are spreaded over the web and books, probably no one will be able to put it in here in short version.
Provided the DPI for the system display is set correctly the WPF should scale the interface appropriately.