Values in xaml is not reflecting in the other classes in a wpf c# application

瘦欲@ 提交于 2019-12-12 04:24:56

问题


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?

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.

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


回答1:


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

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



来源:https://stackoverflow.com/questions/11450638/values-in-xaml-is-not-reflecting-in-the-other-classes-in-a-wpf-c-sharp-applicati

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!