C#/WPF中的MDI [英] MDI in C#/WPF

查看:206
本文介绍了C#/WPF中的MDI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#创建一个WPF应用程序,我需要一个带有菜单和子窗口的MDI窗口.我将子窗口设计为WPF窗口,而不是用户控件. WPF似乎对子窗口的用户控件提供了更多支持,这是不正常的 WPF窗口.而且用户控件没有标题栏等,并且对我的应用程序看起来不太好.单击WPF窗口上的菜单项时,我需要加载相应的Windows中心屏幕,并且具有标题栏,并且不会像拉伸时那样覆盖整个屏幕 MDI窗口的用户区域,这是用户控件的默认行为.有什么方法可以使用WPF窗口,并且仍然能够在MDI应用程序中加载WPF窗口,以便在关闭MDI窗口时,也可以关闭子WPF窗口?

I am creating a WPF application in C# and I need to have an MDI window with Menus and child windows. I have designed my child windows as WPF windows and not user controls. It seems WPF has more support for user controls for child windows and not normal WPF windows. And user controls have not title bars etc and doesn't look good for my app. On clicking menu items on the WPF window, I need to load the corresponding Windows centre screen and has title bars and not appear as stretched out to cover the entire user area of MDI window as is the default behavior with User controls. Is there any way I can use WPF window and still be able to load the WPF window in MDI application so that when the MDI window is closed, the child WPF windows are also closed?

推荐答案


朋友,


Hi friend,

>> 有什么方法可以使用WPF窗口,并且仍然能够在MDI应用程序中加载WPF窗口,以便在MDI窗口关闭时,子WPF窗口也关闭?

据我所知,WPF本身不支持MDI表单.您可以尝试使用第三方扩展来满足您的需求.

As far as I know, WPF itself does not support MDI forms. You can try to use third-party extensions to achieve your needs.

1: WPF多文档界面(MDI):
一个库,用于将传统的Windows窗体多文档界面(MDI)功能添加到WPF.目的是尽可能与原版相似.

1: WPF Multiple Document Interface (MDI):
A library to add the traditional Windows Forms Multiple Document Interface (MDI) features to WPF. The aim is to resemble the original as much as possible.

2: AvalonDock
AvalonDock是WPF的停靠窗口控件,可让您使用功能齐全的窗口停靠系统创建可自定义的布局,该系统类似于许多流行的集成开发环境(IDE)(例如Visual Studio)中的系统

2: AvalonDock
AvalonDock is a docking windows control for WPF that lets you create customizable layouts using a full featured window docking system similar to what is found in many popular integrated development environements (IDEs) such as Visual Studio


注意:此响应包含对第三方万维网站点的引用. Microsoft为方便您而提供此信息. Microsoft不控制这些站点,也没有测试在这些站点上找到的任何软件或信息;所以, Microsoft无法对在此找到的任何软件或信息的质量,安全性或适用性做出任何陈述.使用Internet上发现的任何软件都存在固有的危险,Microsoft提醒您确保自己 从Internet上检索任何软件之前,请完全了解风险.


Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


最好的问候,


Best Regards,

Yohann Lu

Yohann Lu


这篇关于C#/WPF中的MDI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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