如何使用mvvm模式将用户控件值设置为wpf中的主窗口 [英] How to get the user control values to main window in wpf using mvvm pattern

查看:97
本文介绍了如何使用mvvm模式将用户控件值设置为wpf中的主窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户控件中有4个文本框 

I have 4 text boxes in user control 

在我的mainwindow.xaml

In my mainwindow.xaml

   我将点击添加按钮,以便我的用户控制和另一个添加按钮可见。 

    I will be clicking an add button so that my user control and another add button will be visible. 

     在这里,我在用户控件的文本框中输入了所有值,如何将这些值发送到我的视图模型。

     Here I have entered all the values in the text boxes I.e in my user control how to send those values to my view model.

推荐答案

可以你告诉我们文本框的XAML? 如果您没有使用DataBinding,那么您应该。
Can you show us the XAML of the text boxes?  If you are not using DataBinding then you should.


这篇关于如何使用mvvm模式将用户控件值设置为wpf中的主窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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