是否有用于WPF的母版页的概念(如asp.net)? [英] Is there a concept of a master page (like in asp.net) for WPF?

查看:97
本文介绍了是否有用于WPF的母版页的概念(如asp.net)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经启动了WPF(基于Web)应用程序,它具有多个页面.我想在WPF中实现母版页的概念,以便当我在一页的设计/布局中进行更改时,所有其他页都将照此进行,而无需进行所有复制和粘贴.

I've started a WPF (web-based) application and it has multiple pages. I want to implement the concept of a Master page in WPF, so that when I make changes in the design/layout of one page then all the others pages will follow suit without all the copy and paste.

推荐答案

基本上,因为没有页面,所以我认为母版页的概念在WPF中基本上无效. 在WPF中存在样式,模板和DataTemplates.不仅如此,使用DockPanel和其他容器,您还可以实现ASP.NET母版页提供的大多数功能.

I don't think the concept of Master Page is valid in WPF basically because there are no pages. In WPF exists styles, templates and DataTemplates. Not only that, using the DockPanel and other containers you can achieve most of the functionality provided by ASP.NET Master Pages.

无论如何,如果仍然需要母版页,我建议您查看以下文章: http://www.codeproject.com/KB/WPF/WPFMasterPageControl.aspx

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

HTH

这篇关于是否有用于WPF的母版页的概念(如asp.net)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆