xaml中的值未反映在wpf c#应用程序的其他类中 [英] Values in xaml is not reflecting in the other classes in a wpf c# application

查看:94
本文介绍了xaml中的值未反映在wpf c#应用程序的其他类中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个wpf kinect项目,它是Windows kinect的开发者工具包示例之一,并且它的名称为"Kinect Explorer",您可以从kinect开发者工具包sdk ver 1.5中下载它,并添加到kinectwindow.xaml中.一个按钮和一个复选框,还有一个名为kinectskeleton.cs的类,其中我创建了两个数据表和一个布尔变量,第一个数据表填充在onrender函数中,而另一个为空,布尔变量默认设置为false . 所以我想要的是当按下kinectwindow.xaml.cs中的按钮时,将已填充数据表中的最新数据复制到空数据表中,然后选中此复选框时,布尔值设置为true,因此如何执行此操作?

I'm working on a wpf kinect project, its one of the developer toolkit samples of windows kinect and its called "Kinect Explorer" you can download it from the kinect developer toolkit sdk ver 1.5, in the kinectwindow.xaml i added a button and a checkbox, also there is a class called kinectskeleton.cs in which i created two datatables and a boolean variables, the first datatable is filled in the onrender function while the other is empty and the boolean variable is set by default to false. so what i want is when the button in the kinectwindow.xaml.cs is pressed the latest data in the filled datatable is copied to the empty one, then when the checkbox is checked the boolean value is set to true, so how to do this?

我在kinectskeleton.cs类中定义了一个函数,该函数将数据从填充的数据复制到空的datable,在kinectwindow.xaml.cs的按钮的onclick函数中,我从kinectskeletion类创建了一个对象,并将其称为但是两个数据表都是空的,与checkbox_checked函数中的复选框相同,我将kinectskelton类的布尔值设置为true,而在unchecked函数中将其设置为false,但结果是在kinectskelton类中,其始终设置为默认值值false永远不会输入我为true时要输入的if条件.

i defined a function in the class kinectskeleton.cs that copies the data from the filled to the empty datable, and in the onclick function of the button of kinectwindow.xaml.cs i created an opbject from class kinectskeletion and called this function but both datatables are empty, same for the checkbox in the checkbox_checked function i set the boolean value of the class kinectskelton to true and in the unchecked function i set it to false, but the result that in the kinectskelton class its always set to the default value false never enters the if condition i made to enter when its true.

希望它现在更加清晰,并等待任何建议. 要下载工具包,请点击以下链接: http://www.microsoft.com/en-us/kinectforwindows /develop/developer-downloads.aspx

Hope its now more clear and waiting for any suggestions. to download the toolkit here is the link: http://www.microsoft.com/en-us/kinectforwindows/develop/developer-downloads.aspx

推荐答案

您调用任何等效于OnPropertyChanged("yourProperty")吗?

Do you call any equivalent to OnPropertyChanged("yourProperty") ?

您的GUI需要以某种方式获取变量已更改的信息.

Your GUI needs to somehow get the information that the variable has changed.

这篇关于xaml中的值未反映在wpf c#应用程序的其他类中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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