MenuItem added programmatically causes Binding error

前端 未结 2 1370
后悔当初
后悔当初 2021-01-18 03:10

I have a main menu mnuMainMenu consisting of several sub-menus. One of the sub-menus mnuMostRecentDirs is itself another menu that has it\'s items

2条回答
  •  野的像风
    2021-01-18 03:48

    I really think it's not a good idea or ""WPF compatible"" to add UIelemnts from code.

    I would suggest something like this:

        
            
                
                    
                        
                    
                
            
        
    

    and set MainMenu's ItemsSource to MostRecentFoldersList

提交回复
热议问题