using DiscordChatExporter.Core.Services; using DiscordChatExporter.Gui.ViewModels; using DiscordChatExporter.Gui.ViewModels.Framework; using Stylet; using StyletIoC; #if !DEBUG using System.Windows; using System.Windows.Threading; #endif namespace DiscordChatExporter.Gui { public class Bootstrapper : Bootstrapper { protected override void ConfigureIoC(IStyletIoCBuilder builder) { base.ConfigureIoC(builder); // Autobind the .Services assembly builder.Autobind(typeof(DataService).Assembly); // Bind settings as singleton builder.Bind().ToSelf().InSingletonScope(); // Bind view model factory builder.Bind().ToAbstractFactory(); } #if !DEBUG protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e) { base.OnUnhandledException(e); MessageBox.Show(e.Exception.ToString(), "Error occured", MessageBoxButton.OK, MessageBoxImage.Error); } #endif } }