#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.

About these ads

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

One Response to #384 – The Benefits of Flow-Based Layout

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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 365 other followers

%d bloggers like this: