Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider.PointerReleased Event #3076

Closed
edOasiot opened this issue Oct 6, 2019 · 1 comment
Closed

Slider.PointerReleased Event #3076

edOasiot opened this issue Oct 6, 2019 · 1 comment

Comments

@edOasiot
Copy link

edOasiot commented Oct 6, 2019

I can't get the Slider.PointerReleased event to fire - code below

mySlider.PointerReleased += SliderChanged;

void SliderChanged(object sender, PointerReleasedEventArgs e)
{
string name = ((Slider)sender).Name; // Never hit this break point
}

@grokys grokys added this to To do in @grokys todos via automation Oct 11, 2019
@grokys grokys added the bug label Oct 28, 2019
@grokys
Copy link
Member

grokys commented Apr 7, 2020

Apologies for the delay on this. Do you mean when clicking and dragging the slider? This is expected, and its the same in WPF too: the Slider handles the pointer being release to prevent it bubbling to parent controls.

If you want to receive this event, you need to subscribe to the tunneling version of the event (which will be raised before the slider handles the event) by calling AddHandler with RoutingStrategies.Tunnel:

https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Interactivity/Interactive.cs#L52

@grokys grokys closed this as completed Apr 7, 2020
@grokys todos automation moved this from To do to Done Apr 7, 2020
@grokys grokys added question and removed bug labels Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
@grokys todos
  
Done
Development

No branches or pull requests

2 participants