|
|
|
@ -9,37 +9,41 @@ using System.Windows;
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
namespace DiscordChatExporter.Gui
|
|
|
|
|
namespace DiscordChatExporter.Gui;
|
|
|
|
|
|
|
|
|
|
public class Bootstrapper : Bootstrapper<RootViewModel>
|
|
|
|
|
{
|
|
|
|
|
public class Bootstrapper : Bootstrapper<RootViewModel>
|
|
|
|
|
protected override void OnStart()
|
|
|
|
|
{
|
|
|
|
|
protected override void OnStart()
|
|
|
|
|
{
|
|
|
|
|
base.OnStart();
|
|
|
|
|
base.OnStart();
|
|
|
|
|
|
|
|
|
|
// Set default theme
|
|
|
|
|
// (preferred theme will be chosen later, once the settings are loaded)
|
|
|
|
|
App.SetLightTheme();
|
|
|
|
|
}
|
|
|
|
|
// Set default theme
|
|
|
|
|
// (preferred theme will be set later, once the settings are loaded)
|
|
|
|
|
App.SetLightTheme();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void ConfigureIoC(IStyletIoCBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
base.ConfigureIoC(builder);
|
|
|
|
|
protected override void ConfigureIoC(IStyletIoCBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
base.ConfigureIoC(builder);
|
|
|
|
|
|
|
|
|
|
// Bind settings as singleton
|
|
|
|
|
builder.Bind<SettingsService>().ToSelf().InSingletonScope();
|
|
|
|
|
// Bind settings as singleton
|
|
|
|
|
builder.Bind<SettingsService>().ToSelf().InSingletonScope();
|
|
|
|
|
|
|
|
|
|
// Bind view model factory
|
|
|
|
|
builder.Bind<IViewModelFactory>().ToAbstractFactory();
|
|
|
|
|
}
|
|
|
|
|
// Bind view model factory
|
|
|
|
|
builder.Bind<IViewModelFactory>().ToAbstractFactory();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if !DEBUG
|
|
|
|
|
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnUnhandledException(e);
|
|
|
|
|
|
|
|
|
|
MessageBox.Show(e.Exception.ToString(), "Error occured", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnUnhandledException(e);
|
|
|
|
|
|
|
|
|
|
MessageBox.Show(
|
|
|
|
|
e.Exception.ToString(),
|
|
|
|
|
"Error occured",
|
|
|
|
|
MessageBoxButton.OK,
|
|
|
|
|
MessageBoxImage.Error
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|