Answers for "get datacontext of itemscontrol item c#"

C#
0

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
Posted by: Guest on October-15-2020

C# Answers by Framework

Browse Popular Code Answers by Language