Closed nigel-sampson closed 8 years ago
Sounds like the behaviour either isn't detatching properly, or is attaching every time it gets displayed. Out of interest, are we able to try it with another behaviour? Does it do the same thing?
I've tested with a test behavior using this code:
public class TestBehavior : Behavior
{
protected override void OnAttached()
{
base.OnAttached();
Debug.WriteLine("OnAttached");
}
protected override void OnDetaching()
{
Debug.WriteLine("OnDetaching");
base.OnDetaching();
}
}
I can see the OnDetaching
getting called when the menu closes, so I guess this is only related with the EventTriggerBehavior
.
You now have a pull request to fix this! :)
Haven't had a chance to look into the cause yet, but there is a bug where the
EventTriggerBehavior
is interacting incorrectly with the popup secondary commands menu of aCommandBar
.I've put up a quick sample of the bug, but the basics are that it appears the behavior is attached to the click event every time the menu is opened. Therefore when the button is clicked the accompanying action is invoked as many times as the menu was opened previously.