Last active
October 1, 2017 19:01
-
-
Save tomwis/c6d4dc0cc20bbfa9a59b16d15cba9409 to your computer and use it in GitHub Desktop.
This file contains 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
public class ViewModelLocator | |
{ | |
static ViewModelLocator() | |
{ | |
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); | |
SimpleIoc.Default.Register<DashboardViewModel>(); | |
SimpleIoc.Default.Register<MonthEditViewModel>(); | |
SimpleIoc.Default.Register<IDbService>(() => new DbService(DependencyService.Get<IFileService>())); | |
SimpleIoc.Default.Register<INavigationService, NavigationService>(); | |
SimpleIoc.Default.Register<IMonthService, MonthService>(); | |
} | |
public DashboardViewModel Dashboard => ServiceLocator.Current.GetInstance<DashboardViewModel>(); | |
public MonthEditViewModel MonthEdit => ServiceLocator.Current.GetInstance<MonthEditViewModel>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment