Listbox ItemTemplate Selector does not pick a template

后端 未结 1 1468
眼角桃花
眼角桃花 2021-01-17 21:47

I am trying to use an ItemTemplateSelector on a listbox within a grid that I am creating on a different file to later be called by the MainWindow.

Here is my DataTe

1条回答
  •  孤街浪徒
    2021-01-17 21:55

    @Rachel is right. Your DataTemplateSelector only gets invoked once at load pretty much and not for INPC changes.

    What you can do for what you require is use a ListBoxItemStyle with DataTrigger switching the Template used

    something like:

    
      
        
          
          
        
      
    
    
      
        
          
          
        
      
    
    
      
        
          
          
        
      
    
    
    

    and usage:

    
    

    0 讨论(0)
提交回复
热议问题