public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.Register <MainViewModel>(); SimpleIoc.Default.Register <IClientOberver, ClientObserver>(); var client = new IpcClient <string>(".", "test", ServiceLocator.Current.GetInstance <IClientOberver>()); clientWorked = client.Create(); }