#384 – The Benefits of Flow-Based Layout

WPF provides several benefits by making flow-based layout a default.

Resolution Independence

This is not really a benefit of flow-based layout, but a benefit based on the fact that WPF specifies positions and sizes in device independent units, rather than in pixels.  If the current DPI setting matches the native DPI of the device, then the actual size of the GUI elements will be as requested.

Controls Automatically Resized or Repositioned

Flow-based layout containers automatically reposition/resize child controls as the container is resized.

Controls Size to Fit Their Content

In WPF, you typically allow a control to size to fit it’s content.  This removes the need for tweaking size and position of elements if the content changes.

    <StackPanel>
        <Button Content="Bob" HorizontalAlignment="Center"/>
        <Button Content="John Jacob Jingleheimer Smith" HorizontalAlignment="Center"/>
    </StackPanel>

Easier Localization

When controls size to fit their content, you don’t need to tweak layout for each localized language.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #384 – The Benefits of Flow-Based Layout

  1. Pingback: Dew Drop – September 12, 2011 | Alvin Ashcraft's Morning Dew

  2. Larry Hisle says:

    Wasn’t it Jingleheimer _Schmidt_?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: