在MVVM中绑定控件的可见性? [英] Bind Visibility of a control in MVVM?

查看:193
本文介绍了在MVVM中绑定控件的可见性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

开发Windows 8应用程序,

Am developing Windows 8 App,

我的应用程序在哪里使用MVVM流程。

where in my app am using MVVM flow.

点击登录Am Binding登录按钮,在ViewModel中显示继电器命令

On Click of Login Am Binding Login Button with relay command in ViewModel

我还想要显示进度条(即......加载请稍候)到用户同时。

and also i want show Progress bar(i.e., ...Loading Please wait) to the user at the same time.

我如何在viewmodel中实现相同目的。

how do i achieve the same in viewmodel.

任何建议都会有很大的帮助

Any suggestion would be of great help

谢谢




Arjun

推荐答案

您好Arjun,

我相信你需要创建一个可见性属性,并将其绑定到View中的ProgressBar的Visibility属性。你可以试试这个

命令绑定里面的DataTemplate
功能; 样本。

I believe you will need to create a Visibility property in the ViewModel and bind it to the ProgressBar's Visibility property in the View. You can try this through the Command binding inside DataTemplate   sample.

Sagar


这篇关于在MVVM中绑定控件的可见性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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