Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

get datacontext of itemscontrol item c#

//assuming your itemssontrol items each have a click event:
private void Button_Click(object sender, RoutedEventArgs e) 
{ 
    var vm = (sender as FrameworkElement).DataContext; 
	//can cast to specific class type from here
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #datacontext #itemscontrol #item
ADD COMMENT
Topic
Name
7+8 =