Is it possible to detect this hardware event in a cross-platform way?

I have a Xamarin Forms PCL which has a content page with some sliders. I want to adjust the range of these sliders based on whether or not headphones are plugged in.

As a starting point, I played around with detecting whether or not headphones are plugged in at the time of a button press. That code is found here.
https://forums.xamarin.com/discussion/comment/302005

But what I need is an event handler for this.

It seems that if I were strictly writing an Android Project with Xamarin, I'd use a Local Broadcast Manager

and

If I were strictly writing an iOS project with Xamarin, I'd use NSNotificationCenter

But is there any way I modify a PCL Content Page based on an event like this? How would that work?

Thanks,

Nick

Answers

Sign In or Register to comment.