/// XF Project | |
namespace UsingDependencyService | |
{ | |
public interface IToDo { | |
void ToDo (); //note that interface members are public by default | |
} | |
} | |
namespace UsingDependencyService.Service | |
{ | |
public void DoSomething() | |
{ | |
... | |
DependencyService.Get<IToDo>().ToDo(); // DependencyService Call | |
... | |
} | |
} | |
/// Android Project | |
[assembly: Dependency (typeof (ToDo_Android))] | |
namespace UsingDependencyService.Android | |
{ | |
public class ToDo_Android : IToDo | |
{ | |
public void ToDo () | |
{ | |
... // here your things to do | |
} | |
} | |
} | |
/// iOS Project | |
[assembly: Dependency (typeof (ToDo_iOS))] | |
namespace UsingDependencyService.iOS | |
{ | |
public class ToDo_iOS : IToDo | |
{ | |
public void ToDo () | |
{ | |
... // here your things to do | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment