How do I right-align the 'help' menu item in WPF?

前端 未结 6 517
后悔当初
后悔当初 2020-12-23 19:34

I have the following (simplifed) section in my XAML file:


    

        
6条回答
  •  遥遥无期
    2020-12-23 20:13

    Another possible answer, if you always know how many menu items there will be (and that makes this answer fragile), is to define the Menu.ItemsPanel as a grid, set the Menu to Stretch, set the Grid.ColumnDefinitions appropriately, set the MenuItems to the appropriate Grid.Column, and set the HorizontalAlignment of the last menu item as Right.

       
            
                
                    
                        
                            
                            
                            
                        
                    
                
            
            
                
            
            
                
            
            
                
            
        
    

提交回复
热议问题