How to reference a generic type in the DataType attribute of a DataTemplate?

后端 未结 8 1435
深忆病人
深忆病人 2020-12-18 18:19

I have a ViewModel defined like this:

public class LocationTreeViewModel : 
    ObservableCollection, INotifyPropertyChanged
               


        
8条回答
  •  情深已故
    2020-12-18 18:57

    The {x:Type} markup extension supports allows generic type arguments to be specified as a comma separated list in parentheses.

    Here's an example:

    
        
            
                
            
        
    
    

    I am using .Net 4.5 on VS 2015, so your mileage may vary.

提交回复
热议问题