Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Freshmvvm.FreshIOC.Container.Register<ICamera,Camera>();
  2.  
  3. public interface ICamera
  4. {
  5. void TakePicture();
  6. }
  7.  
  8. [assembly: Xamarin.Forms.Dependency (typeof (CameraImplementation))]
  9. namespace yourapp
  10. {
  11. // CameraImplementation class here
  12. }
  13.  
  14. public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  15. {
  16. global::Xamarin.Forms.Forms.Init();
  17.  
  18. InitIoc();
  19.  
  20. LoadApplication(new App());
  21.  
  22. return base.FinishedLaunching(app, options);
  23. }
  24.  
  25. private void InitIoc()
  26. {
  27. FreshMvvm.FreshIOC.Container.Register<IFileHelper, FileHelper>();
  28. }
  29.  
  30. public class FileHelper : IFileHelper
  31. {
  32. public string GetLocalFilePath(string filename)
  33. {
  34. string docFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
  35.  
  36. IFileHelper fileHelper = FreshMvvm.FreshIOC.Container.Resolve<IFileHelper>();
  37. string dbPath = fileHelper.GetLocalFilePath("CoreSQLite.db3");
  38.  
  39. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement