How do I reuse item children via a style in XAML?

后端 未结 1 1559
梦谈多话
梦谈多话 2021-01-24 18:50

I have a WPF submenu that I want to reuse in a few places in my XAML. It\'s a collection of eight elements with some complicated bindings that I do

1条回答
  •  爱一瞬间的悲伤
    2021-01-24 18:56

    How about something like this:

    You'll need to create the following collection in your resource dictionary:

    
        
        
        
    
    

    You'll need to add the following namespace:

    xmlns:Collections="clr-namespace:System.Collections;assembly=mscorlib"
    

    ...

    And then just use the collection:

    
    

    ...

    
        
    
    

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