using CommonServiceLocator; using DiscordChatExporter.Core.Services; using DiscordChatExporter.Gui.ViewModels; using GalaSoft.MvvmLight.Ioc; namespace DiscordChatExporter.Gui { public class Container { public IExportSetupViewModel ExportSetupViewModel => Resolve(); public IMainViewModel MainViewModel => Resolve(); public ISettingsViewModel SettingsViewModel => 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(); SimpleIoc.Default.Register(); // View models SimpleIoc.Default.Register(true); SimpleIoc.Default.Register(true); SimpleIoc.Default.Register(true); } public void Cleanup() { } } }