3

In MFC, dialog boxes were designed using DLUs. In WPF, we specify in 1/96inch units. While this would indeed scale windows and visual elements, how do we make make WPF "respect" the current font settings of the user? Should we specify a certain font to be used and stick to that font?

How would one go about layout-ing a "well behaved application"

  • adjusts window sizes to accommodate the current font settings and resolution
  • reflows/layouts windows/text gracefully for small screens.

Any help or guidelines would be appreciated? (Windows User Experience Guidelines is clear about what should happen, but now how it could be implemented in WPF).

moogs
  • 8,122
  • 8
  • 44
  • 60
  • i asked a similar question 3 years ago and never got an answer (http://stackoverflow.com/questions/395195/wpf-how-to-specify-units-in-dialog-units). By now it is probably safe to say that WPF cannot be used if you want to have a quality application. – Ian Boyd Aug 21 '11 at 03:33

1 Answers1

1

We handle this by applying the font size and style settings to all text objects in the WPF UI. This can be accomplished at run time and can also be modified on the fly. One thing you have to really be careful of however is the layout of the UI. It has to be more fluid (dynamic) when allowing this type of customization. I normally have minimum sizes set for my windows and controls to help accommodate this. Stack / Wrap Panels can make this easier to accomplish. Also using Grids with * notation can allow for text boxes and labels to expand as needed.

Note this is also a requirement when creating localized applications as certain languages translate into much longer strings thus wrapping and resizing is critical.

tsells
  • 2,751
  • 1
  • 18
  • 20