using CommonServiceLocator; using DiscordChatExporter.Cli.ViewModels; using DiscordChatExporter.Core.Services; using GalaSoft.MvvmLight.Ioc; namespace DiscordChatExporter.Cli { public class Container { public IMainViewModel MainViewModel => Resolve(); public ISettingsService SettingsService => Resolve(); private T Resolve(string key = null) { return ServiceLocator.Current.GetInstance(key); } public void Init() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.Reset(); // Services SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); // View models SimpleIoc.Default.Register(true); } public void Cleanup() { } } }