mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-17 15:08:24 +00:00
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System.Reflection;
|
|
using System.Windows.Input;
|
|
using DiscordChatExporter.Messages;
|
|
using DiscordChatExporter.ViewModels;
|
|
using GalaSoft.MvvmLight.Messaging;
|
|
using MaterialDesignThemes.Wpf;
|
|
using Tyrrrz.Extensions;
|
|
|
|
namespace DiscordChatExporter.Views
|
|
{
|
|
public partial class MainWindow
|
|
{
|
|
private IMainViewModel ViewModel => (IMainViewModel) DataContext;
|
|
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
Title += $" v{Assembly.GetExecutingAssembly().GetName().Version}";
|
|
|
|
Messenger.Default.Register<ShowErrorMessage>(this, m => DialogHost.Show(new ErrorDialog()).Forget());
|
|
Messenger.Default.Register<ShowExportDoneMessage>(this, m => DialogHost.Show(new ExportDoneDialog()).Forget());
|
|
Messenger.Default.Register<ShowExportSetupMessage>(this, m => DialogHost.Show(new ExportSetupDialog()).Forget());
|
|
Messenger.Default.Register<ShowSettingsMessage>(this, m => DialogHost.Show(new SettingsDialog()).Forget());
|
|
}
|
|
|
|
public void TokenTextBox_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.Key == Key.Enter)
|
|
{
|
|
// Execute command
|
|
ViewModel.PullDataCommand.Execute(null);
|
|
}
|
|
}
|
|
}
|
|
} |