/// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); ////if (ViewModelBase.IsInDesignModeStatic) ////{ //// // Create design time view services and models //// SimpleIoc.Default.Register<IDataService, DesignDataService>(); ////} ////else ////{ //// // Create run time view services and models //// SimpleIoc.Default.Register<IDataService, DataService>(); ////} SimpleIoc.Default.Register <ISettingsService>(() => SettingsService.Instance); var unitOfWork = new UnitOfWork(new DBLocalChatContext("LocalChatServerConnectionString")); SimpleIoc.Default.Register <IUnitOfWork>(() => unitOfWork); var wcfHostService = new WCFHostService(unitOfWork); SimpleIoc.Default.Register <IWCFHostService>(() => wcfHostService); SimpleIoc.Default.Register <IDialogService, DialogService>(); SimpleIoc.Default.Register <SettingsViewModel>(); SimpleIoc.Default.Register <ServerViewModel>(); }
public WCFHost() { InitializeComponent(); _service = new WCFHostService(); }