Referencing controls in a WPF DataTemplate?

The easiest way to do it is to have the class that is representing items in your ListBox ItemsSource to have all the fields that you are referencing in your DataTemplate. Then in your button handler you can access the new pledge info by using the data context of the button.

Thanks, Andrew, that did it. The key was that I had to create a separate DataContext for the DockPanel in question, and then bound it to a new instance of the Pledge object created higher up in the template.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions