当您在解决方案资源管理器中添加新文件时,WPF中的页面和窗口之间有什么区别?
当前回答
页面用于导航应用程序(通常带有后退和前进按钮,例如Internet Explorer)。页面必须驻留在导航窗口或框架中
Windows只是普通的WPF应用程序Windows,但可以通过框架容器承载页面
其他回答
页面用于导航应用程序(通常带有后退和前进按钮,例如Internet Explorer)。页面必须驻留在导航窗口或框架中
Windows只是普通的WPF应用程序Windows,但可以通过框架容器承载页面
一个窗口总是独立显示,一个页面是要显示在一个框架或在一个导航窗口。
主要的区别是窗口是完整的作为一个整体,不能包含在一个页面,但反之亦然。页面用于在同一窗口中为用户提供不同的选项卡。
见附图
页面控件可以包含在窗口控件中,反之则不可能
You can use Page control within the Window control using NavigationWindow and Frame controls. Window is the root control that must be used to hold/host other controls (e.g. Button) as container. Page is a control which can be hosted in other container controls like NavigationWindow or Frame. Page control has its own goal to serve like other controls (e.g. Button). Page is to create browser like applications. So if you host Page in NavigationWindow, you will get the navigation implementation built-in. Pages are intended for use in Navigation applications (usually with Back and Forward buttons, e.g. Internet Explorer).
WPF使用Page类在独立应用程序中提供浏览器样式导航的支持。用户可以创建多个页面,在这些页面和数据之间导航。有多种方法可以从一个页面导航到另一个页面。
推荐文章
- dynamic (c# 4)和var之间的区别是什么?
- Visual Studio: ContextSwitchDeadlock
- 返回文件在ASP。Net Core Web API
- 自定义HttpClient请求头
- 如果我使用OWIN Startup.cs类并将所有配置移动到那里,我是否需要一个Global.asax.cs文件?
- VS2013外部构建错误"error MSB4019: The imported project <path> was not found"
- 从另一个列表id中排序一个列表
- 等待一个无效的异步方法
- 无法加载文件或程序集…参数不正确
- c#中枚举中的方法
- 如何从字符串中删除新的行字符?
- 如何设置一个默认值与Html.TextBoxFor?
- 检查属性是否有属性
- 格式化XML字符串以打印友好的XML字符串
- 返回内容与IHttpActionResult非ok响应