Check Object type in List of Objects

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

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


    

        
4条回答
  •  故里飘歌
    2021-01-28 13:27

    I would do something like this: use the Enumerable.OfType<>()

    More info: https://msdn.microsoft.com/en-us/library/vstudio/bb360913(v=vs.100).aspx

    foreach(var stackpanel in tmpList.OfType())
    {
        // search for the label. (the same trick)
        var myLabel = stackpanel.Children.OfType

提交回复
热议问题