Nihau
Nihau

Reputation: 306

Multiple pages in a single window C# WPF

Is there a control that allows to choose data, that should be in it? For example: red one - static page, blue is dynamic, below are buttons that allow to switch pages in dynamic part. enter image description here

Upvotes: 1

Views: 1867

Answers (3)

Jaster
Jaster

Reputation: 8581

This is achived by using DataTemplates. You just bind the SelectedItem of the "red" control (e.g. a ListView) to the Content of the "blue" Control (it should be a ContentPresenter). You add DataTemplates to the Resources accessable by the "blue" control which will then display different content depending on the underlaying class/data.

Upvotes: 0

Gusdor
Gusdor

Reputation: 14334

Try using a ContentControl databound to a property on your UserControl. Change the property when you want to update the content. Ensure that the property is either and DependencyProperty or that your user control implements INotifyPropertyChanged.

http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx

Upvotes: 1

Peter
Peter

Reputation: 27934

I use the dockpanel suite for this:

dockpanel suite

This contol is designed to mimic the vs.net tabs.

Upvotes: 1

Related Questions