This project has moved and is read-only. For the latest updates, please go here.

How to make DropDownButton display menu?

Jan 5 at 4:02 AM
The DropDownButton UI element is very often used to show a menu. Can this be done with the Extended Toolkit DropDownButton? If so, how?
Developer
Jan 5 at 7:54 PM
Hi,

How about :
 <xctk:DropDownButton Content="MyMenu">
      <xctk:DropDownButton.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Cut"
                        Executed="CutCmdExecuted"
                        CanExecute="CutCmdCanExecute" />
        <CommandBinding Command="ApplicationCommands.Copy"
                        Executed="CopyCmdExecuted"
                        CanExecute="CopyCmdCanExecute" />
        <CommandBinding Command="ApplicationCommands.Paste"
                        Executed="PasteCmdExecuted"
                        CanExecute="PasteCmdCanExecute" />
      </xctk:DropDownButton.CommandBindings>
      <xctk:DropDownButton.DropDownContent>
        <StackPanel>
          <Button Content="Option A"
                  Command="ApplicationCommands.Cut" />
          <Button Content="Option B"
                  Command="ApplicationCommands.Copy" />
          <Button Content="Option C"
                  Command="ApplicationCommands.Paste" />
        </StackPanel>
      </xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
 private void CutCmdExecuted( object target, ExecutedRoutedEventArgs e )
    {
    }
    private void CutCmdCanExecute( object sender, CanExecuteRoutedEventArgs e )
    {
      e.CanExecute = true;
    }

    private void CopyCmdExecuted( object target, ExecutedRoutedEventArgs e )
    {
    }
    private void CopyCmdCanExecute( object sender, CanExecuteRoutedEventArgs e )
    {
      e.CanExecute = true;
    }

    private void PasteCmdExecuted( object target, ExecutedRoutedEventArgs e )
    {
    }
    private void PasteCmdCanExecute( object sender, CanExecuteRoutedEventArgs e )
    {
      e.CanExecute = true;
    }
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF