切换Xaml视图的最佳技术是什么? [英] What is best technique for switching Xaml views?

查看:66
本文介绍了切换Xaml视图的最佳技术是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Viewmodel的替代 xaml视图,并且我目前正在使用一种在视图上设置样式属性(包含控件模板)的技术,并且想知道什么是最好的/首选的Caliburn技术-调用约定,绑定等,这些约定是由Caliburn在显示视图模型时最初设置的。

I have "alternative" xaml views for a viewmodel and I am currently using a technique where I set the style property on the view (containing a control template) and would like to know what is the best/preferred Caliburn technique to re-invoke conventions, bindings, etc., that are setup initially by Caliburn when showing the viewmodel.

我使用的是View-Model-First方法,所以可能是我使用了错误的技术,应该研究一种方法(例如View上下文)鼓励更改?

I am using a View-Model-First approach, so possibly I am using the wrong technique and should be looking at a way (e.g. View contexts) to have the Viewmodel instigate the change?

谢谢

推荐答案

< ContentControl cm:View.Context = {Binding CurrentView,Mode = TwoWay} cm:View.Model = {Binding} />

1个视图模型技术上的多个视图。然后,文件夹结构将稍有不同,以帮助组织,但是名称空间是如何将视图放置到contentcontrol内容中的。我在多个项目中使用了这个

Multiple views over 1 viewmodel technique. Then the folder structure would be slightly different to help organize but namespace is how view is found to place into the contentcontrol content. I use this in multiple projects

Viewmodel逻辑有助于视图切换。

Viewmodel logic facilitates the view "switching".

这篇关于切换Xaml视图的最佳技术是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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