Tutorial :Load WPF themes based on Monitor Resolution


I facing quite big problem with resolution in my WPF app, which will be used in Hospitals, customer is asked for BIG fonts and Controls so that they can see data clearly from the distance.

The problem is now when application runs in 800X600 resolution, whole UI will get messed up, so I thought to define another theme for lower monitor resolution, now how I could load themes from C# code ??

OR you guys got better idea??


I think you may be able solve this issue with the Viewbox control. Paste this XAML into a new Window and run it.

<Viewbox>      <StackPanel>          <Button>One</Button>          <Button>Two</Button>          <Button>Three</Button>      </StackPanel>  </Viewbox>  

When the Window is re-sized, the contents including fonts are scaled.

For some reason, the designer in Visual Basic 2008 Express fails to paint anything inside the Viewbox. That may be a deal-breaker for you if it happens in Pro or TS.


Have a look at this article. It uses the SizeTemplateControl from PhotoSuru to show different layouts based on the screen res or window size!

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »