Skip to content

Instantly share code, notes, and snippets.

@suchithm
Last active October 15, 2020 13:46
Show Gist options
  • Save suchithm/88209b3787bd838eb2ac3f4505e1263f to your computer and use it in GitHub Desktop.
Save suchithm/88209b3787bd838eb2ac3f4505e1263f to your computer and use it in GitHub Desktop.
ViewModelLocator
using CommonServiceLocator;
namespace SampleAutoFacDI.ViewModels
{
public class ViewModelLocator
{
static ViewModelLocator()
{
AutoFacContainer.Initialize();
}
public MainPageViewModel MainPageViewModel
{
get
{
return ServiceLocator.Current.GetInstance<MainPageViewModel>();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment