This is a pretty tricky question. Basically, WPF was created to create a permission-independent application. For example, all values ââ(width, height, etc.) are located in Device Independent Pixels , where each dot has a size of 1/96 inch (which corresponds to one pixel per dot for a monitor with a DPI value set to 96).
But, of course, this will not allow creating applications completely independent of the device. Here you need to remember that you need to use the appropriate layout mechanisms, for example, using DockPanel , StackPanel or Grid , and not Canvas . Your controls should be set to fill the entire available space ( HorizontalAlignment set to Stretch ), only some should have explicitly set Width or Height .
This is a pretty big topic, good practices that will allow you to complete your task are distributed across the network and books, probably no one can post it here in the short version.
source share