Prev | Current Page 240 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"


Dynamic Content
As the column of settings demonstrates, windows that use the WPF layout containers are easy
to change and adapt as you revise your application. This flexibility doesn??™t just benefit you at
design time. It??™s also a great asset if you need to display content that changes dramatically.
One example is localized text??”text that appears in your user interface and needs to be
translated into different languages for different geographic regions. In old-style coordinatebased
applications, changing the text can wreak havoc in a window, particularly because a
short amount of English text becomes significantly larger in many languages. Even if elements
are allowed to resize themselves to fit larger text, doing so often throws off the whole balance
of a window.
CHAPTER 4 n LAYOUT 113
Figure 4-21 demonstrates how this isn??™t the case when you use the WPF layout containers
intelligently. In this example, the user interface has a short text and a long text option. When
the long text is used, the buttons that contain the text are resized automatically and other content
is bumped out of the way. And because the resized buttons share the same layout
container (in this case, a table column), that entire section of the user interface is resized. The
end result is that all buttons keep a consistent size??”the size of the largest button.


Pages:
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252