Check Object type in List of Objects

后端 未结 4 1136
刺人心
刺人心 2021-01-28 13:03

Got a WPF Form with a StackPanel containing Expanders with StackPanels in it.


    

        
4条回答
  •  -上瘾入骨i
    2021-01-28 13:12

    If I understand You correctly you can use this LINQ Expression

    var w = tmpList.Where(x=>x.IsTypeOf(StackPanel)).SingleOrDefault();
    

提交回复
热议问题