WPF 浏览器应用程序上的用户控件、页面与窗口
您知道 WPF 浏览器应用程序上的用户控制、页面和Windows之间有什么区别吗?我找到了与此相关的信息,但一直都是关于 WPF 桌面应用程序。
WPF 浏览器应用程序有什么不同吗? 我正在部署一个应用程序,但我不知道登录部分、主要部分、关于部分等的最佳选项是什么。
有人可以解释一下如何在 WPF 浏览器应用程序中使用此工具吗?
提前致谢!
Do you know what is the difference between: User Control, Pages and Windows on WPF Browser Applications. I've found information related with this, but all the time are about WPF Desktop application.
Is it different for WPF Browser application?
I'm deploying an application but I don't know what is the best option for the Login section, the main section, the about section, etc.
Could someone explain me how can I use this tools in WPF Browser application?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 XBAP 中使用
Pages
的方式与在 WPF 中使用Window
对象的方式完全相同。也就是说,很少。我的应用程序通常只有一个页面/窗口,仅此而已。切换当前视图通常是通过切换我的
ApplicationViewModel
中的CurrentView
属性来完成的,这会更改主页中显示的视图。当我想要创建某种通用控件或为我的
视图
创建某种通用控件时,我会使用UserControls
。我的Views
也可以是DataTemplates
,对于我来说,在UserControl.Resources
中拥有一个 UserControl 视图并且还具有其他视图的情况并不少见。 (假设所有视图都是相关的)例如,我可能有一个名为
ProductsView
的 UserControl,它是显示Product
对象列表的视图,并且UserControl.Resources
将包含一个名为ProductView
的 DataTemplate,它定义 WPF 应如何显示ProductModel
。I use
Pages
in XBAPs the exact same way I would use aWindow
object in WPF. That is to say, rarely.I usually have one Page/Window for my application and that is it. Switching the current view is usually done by switching a
CurrentView
property in myApplicationViewModel
, which changes what View is displayed in the main page.I use
UserControls
when I want to create some kind of generic control, or for myViews
. MyViews
can also beDataTemplates
, and it is not uncommon for me to have a UserControl View that also has other Views in theUserControl.Resources
(providing that all Views are related)For example, I might have a UserControl called
ProductsView
which is the View that displays a list ofProduct
objects, and theUserControl.Resources
will contain a DataTemplate calledProductView
which defines how WPF should display theProductModel
.