Is there a homepage concept (e.g. asp.net) for WPF?

I launched the WPF application (web application) and it has several pages. I want to implement the concept of the main page in WPF, so when I make changes to the design / layout of one page, then all the other pages will follow the example without copying and pasting.

+6
wpf master-pages xbap
source share
5 answers

I do not think that the concept of the main page is valid in WPF, mainly because there are no pages. WPF has styles, templates, and DataTemplates. Not only that, using DockPanel and other containers, you can achieve most of the functionality provided by the main ASP.NET pages.

In any case, if you still need the main pages, I suggest checking out this article: http://www.codeproject.com/KB/WPF/WPFMasterPageControl.aspx

Hth

+3
source share
+3
source share

use the main view and place the ContentControl with the main view, then bind the Content property to the property in the data context and set the UserControl instance property for it, which will then populate the content section.

I will tell in more detail later

+1
source share

You can use global styles to apply a consistent look to your application. As for the functionality of the main page. Take a look at the MVVM pattern. Microsoft has an implementation, but there are others.

Allows you to define a shell in xaml and specify regions that act as a content repository in ASP.NET. Then you write user controls that load into those areas in the shell. This is much more than using the main page with ASP.NET. But conceptually similar to the screen layout.

As always, not a bad place to start getting a review http://en.wikipedia.org/wiki/MVVM

Tons of more stuff on MSDN, etc.

+1
source share

You can use the Prism open source framework (downloadable using templates and practices: Prism ) and using this, you can create a Shell Window that can be used as MainWindow for your WPF project. Then inside the Shell window, you can create Regions and enter your views in these areas.

What MSDN says about Shell is described below (see Writing a User Interface with Prism ):

A shell is the root object of an application that contains the main content of the user interface. In a Windows Presentation Foundation (WPF) application, a wrapper is a Window object. In a Silverlight application, the shell is a RootVisualUserControl. The wrapper acts as the home page that provides the layout structure for the application. The shell contains one or more of these areas, where the modules can indicate the views that will be displayed. It can also define certain top-level user interface elements, such as the background, main menu, and toolbar. The shell defines the overall appearance of the application. It can determine the styles and borders that are present and visible in the very location of the shell, and it can also determine the styles, patterns, and themes that will be applied to the views that are connected to the shell. Typically, a shell is part of a WPF application project or a major Silverlight project. An assembly containing a shell may or may not refer to assemblies containing views that must be loaded in the shell area.

The basic structure of the Prism frame with WPF:

enter image description here

+1
source share

All Articles