Hayk Vatyan
Добрый день есть токой пример
[assembly: Xamarin.Forms.Dependency(typeof(CurrentLocationService_Android))]
namespace AndroidToPcl.Droid.Dependencies
{
public class CurrentLocationService_Android: PositionChange
{
public static CurrentLocationService_Android () {}
public event EventHandler positionChanged;
public void start ()
{
myself = this;
var context = Xamarin.Forms.Forms.Context;
Intent intent= new Intent(context, typeof(ChangeActivity));
context.StartActivity(intent);
}
public void receivedNewPosition (CustomPosition pos)
{
positionChanged (this,new positionEventArgs(pos.update));
}
}
}
Но компилятор говорит что невозможно использовать static в nonstatic class
Мне нужно написать дебенденси с эвентом как это сделать ?
Ты делаешь статический конструктор в нестатическом классе, сделай его обычным