WPF内容切换 [英] WPF Content switching

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

问题描述

你好!我已尝试使用谷歌搜索,但未找到答案.

我希望能够像MSN Messenger控制面板一样进行操作.

http://bayimg.com/aAOlBaaDM [ ^ ]

http://bayimg.com/aaOlEaaDM [ ^ ]

我希望能够在框架"中切换所有内容,并且仍然能够使用Visual Studio设计器来设置页面",但是我不知道如何操作.我现在想学习正确的方法,而不是自己动手:P

该内容切换将成为生产支持窗口的一部分,根据进度的不同,该窗口将具有不同的阶段.

感谢您在此处提供的帮助:=)

Hello! I have tried googling, but not found answer.

I want to be able to do like MSN Messenger control panel does.

http://bayimg.com/aAOlBaaDM[^]

http://bayimg.com/aaOlEaaDM[^]

I want to be able to switch all content in a "frame" and still be able to use the Visual Studio designer to sett up the "pages" but i dont know how. I want to learn the correct way now, and not "getting it to work" on my own hand :P

This content switching will be part of a productionsupport window wich will have different stages depending on progress.

Thanks for any help here :=)

推荐答案

现在无法看到该示例,因为该示例已被过滤.如果您想在设计时看到设计,我要做的就是用内容创建UserControls,然后插入UserControl.您可以使用ValueConverter,它将基于ViewModel(即DataContext)将正确的View插入到内容控件中.

请注意,您也可以使用Prism,但是在Prism中进行Regions的学习曲线有些陡峭.

希望这已经足够清楚了,并且是对正确问题的答案.

克利福德
Right now cannot see the example because it is filterd. If you want to see the design when you are designing, what I would do is create UserControls with the content, and just insert the UserControl. You can use a ValueConverter that will insert the right View into a content control based on the ViewModel that is the DataContext.

Note that you can also use Prism, but the learning curve for doing Regions in Prism is a little steep.

Hopefully that is clear enough, and the answer to the right question.

Clifford


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

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