Last active
December 10, 2018 01:01
-
-
Save luismts/1e72a4137de371adcfa9e9734af5e50c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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