Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: How to make DropDownButton display menu?

$
0
0
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

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>