HandyControl icon indicating copy to clipboard operation
HandyControl copied to clipboard

SplitButton can not raise Command

Open CodingOctocat opened this issue 1 year ago • 1 comments

Describe the bug

I create a SplitButton, At first I used Click event, but clicking on the dropdown button also triggers Click event, which is not what I want.

Then I used Command, but it never triggered the command. I tried HandyControl's SimpleRelayCommand, AsyncComand etc. but to no avail!

Steps to reproduce the bug

  1. Create a SplitButton
  2. Add Command(SimpleRelayCommand)

Expected behavior

No response

Screenshots

No response

NuGet package version

HandyControls (Custom version) 3.4.0

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

Windows 11 (22000)

Additional context

No response

CodingOctocat avatar Jul 30 '22 03:07 CodingOctocat

Share a temporary solution to this issue:

private void MySplitButton_Click(object sender, RoutedEventArgs e)
{
    if (MySplitButton.IsDropDownOpen)
    {
        return;
    }

   // Do something.
}

CodingOctocat avatar Jul 31 '22 10:07 CodingOctocat

can not reproduce, pls provide demo.

NaBian avatar Aug 22 '22 13:08 NaBian

I created a new simple example, but I can't reproduce the problem either, and since my problem project has changed, I can't restore it for now, and this issue is closed for now.

CodingOctocat avatar Aug 23 '22 12:08 CodingOctocat