Button下拉式菜单

对于Button下拉式菜单,代码如下:

 

   

Backside代码如下:

   private void PopupMenu_Click(object sender, RoutedEventArgs e)
        {

            this.contextMenu.PlacementTarget = this.PopupMenu;
            this.contextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
            this.contextMenu.IsOpen = true;
        }

你可能感兴趣的:(wpf开发)