是通过传递引用x:Reference来从视图模型中关闭视图的好方法 [英] is it a good way to close a view from a viewmodel by passing a reference x:Reference

查看:69
本文介绍了是通过传递引用x:Reference来从视图模型中关闭视图的好方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello EveryBody



作为Title Said,将视图的引用发送到viewmodel是一个很好的做法,所以我可以通过使用它来关闭它CommendParameter = {x:参考名称= NameOfTheView}。?



如果不是最好的方法是什么?



非常感谢您的时间。

Hello EveryBody

As the Title Said is it a good practice to send a reference of the view to the viewmodel so i can close it from there by using the CommendParameter={x:Reference Name=NameOfTheView}.?

if not what would be the best way to do that?

Thank you so much for your time.

推荐答案

如果您关注MVVM,视图模型应该不了解视图。
If you follow MVVM, the viewmodel should not know something about the view.


这篇关于是通过传递引用x:Reference来从视图模型中关闭视图的好方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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