Skip to content

Instantly share code, notes, and snippets.

@bbenetskyy
Created November 20, 2022 17:06
Show Gist options
  • Save bbenetskyy/67945632b9f8e1627d002d0a2ee21c90 to your computer and use it in GitHub Desktop.
Save bbenetskyy/67945632b9f8e1627d002d0a2ee21c90 to your computer and use it in GitHub Desktop.
using LocationUpdates.Models;
namespace LocationUpdates.Services;
public partial class LocationService
{
public event EventHandler<LocationModel> LocationChanged;
public event EventHandler<string> StatusChanged;
public void Initialize()
{
#if ANDROID
AndroidInitialize();
#elif IOS
IosInitialize();
#endif
}
public void Stop()
{
#if ANDROID
AndroidStop();
#elif IOS
IosStop();
#endif
}
protected virtual void OnLocationChanged(LocationModel e)
{
LocationChanged?.Invoke(this, e);
}
protected virtual void OnStatusChanged(string e)
{
StatusChanged?.Invoke(this, e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment