Take the 2-minute tour ×

I'm trying to make a window layout usable from different windows. enter image description here

As you can see from image, I've got a logo, a left vertical progress bar and two control buttons in the bottom part of the window (plus menu bar and status bar).

Those parts should be always the same in different windows, and play/stop should be interacting run-time with the common parts but also with parts build in the middle of the window ("part in each window different").

I can't understand what i should use for creating a standard layout callable from each window where I need it, made in a way were I can replace for each of those windows just the middle part.

Any tips? I probably just need to understand the way to go (sad to be c# wpf newbie)!

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

You can use a content control and then just switch the content

Master page for regions

This link has what you need. You can put the page templates in a separate file if you will be doing lots of content switching

share|improve this answer
add comment

If you create a user control with a <ContentPresenter> where you want the variable content to be, you can inject your own controls into the user control.

The user control would look like:

    <!-- Header Stuff -->

    <ContentPresenter Name="MyContentPresenter" />

    <!-- Footer Stuff -->

In your windows, you'd have:

        <!-- your window specific code here -->

You will need to expose a property called Content on your user control that returns/sets the Content property of the ContentPresenter element on the user control.

In the code-behind of the user control:

public object Content
  get { return MyContentPresenter.Content; } 
  set { MyContentPresenter.Content = value; } 
share|improve this answer
add comment

Your Answer


