System.TypeInitializationException in Uwp using mvvm?

Nov 3 2016 7:29 AM
Viewmodel:
 
public class AddEngineerViewModel:BindableBase
{
IAddEngineerDataService _engineerDataService;
IDialogServices _dialog;
public AddEngineerViewModel(IAddEngineerDataService AddEngineerDataService,IDialogServices Dialog)
{
_engineerDataService = AddEngineerDataService;
_dialog = Dialog;
LoadCommand();
}
private AddEngineerModel _addEngineer;
public AddEngineerModel AddEngineer
{
get { return _addEngineer; }
set
{
_addEngineer = value;
RaisePropertyChanged("AddEngineer");
}
}
public ICommand AddEngineerCommand { get; set; }
public ICommand ViewEngineerCommand { get; set; }
private void LoadCommand()
{
AddEngineerCommand = new CustomCommand(Add, CanAdd);
ViewEngineerCommand = new CustomCommand(Views, CanView);
}
private void Views(object obj)
{
_dialog.ShowDialog();
}
private bool CanView(object obj)
{
return true;
}
private bool CanAdd(object obj)
{
return true;
}
private void Add(object obj)
{
_engineerDataService.Add_Engineer_Details(_addEngineer);
}
}
 
Locator:
 
public class ConstructionLocator
{
private static IDialogServices _dialog = new DialogServices();
private static IAddEngineerDataService _addEngineerDataServices = new AddEngineerDataServices(new AddEngineerData());
private static AddEngineerViewModel _addEngineerViewModel = new AddEngineerViewModel(_addEngineerDataServices, _dialog);
private static ViewEmployeeViewModel _viewEmployeeViewModel = new ViewEmployeeViewModel(_addEngineerDataServices, _dialog);
public static AddEngineerViewModel AddEngineerViewModel
{
get { return _addEngineerViewModel; }
}
public static ViewEmployeeViewModel ViewEmployeeViewModel
{
get { return _viewEmployeeViewModel; }
}
}
 
When navigate to view on button click it shows Type initializer threw exception in locator file of addengineerviewmodel static property. Above are my locator and viewmodel. what would be the problem?