📜  获取itemscontrol item的datacontext c# Code Example

📅  最后修改于: 2022-03-11 14:48:46.351000             🧑  作者: Mango

代码示例1
//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