mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-09 21:02:35 +00:00
Implement auto-update via Onova
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MaterialDesignThemes.Wpf
|
||||
using System.Windows.Interactivity;
|
||||
using MaterialDesignThemes.Wpf
|
||||
using MaterialDesignThemes.Wpf.Transitions
|
||||
|
||||
Window "DiscordChatExporter.Gui.Views.MainWindow" {
|
||||
@@ -19,15 +20,27 @@ Window "DiscordChatExporter.Gui.Views.MainWindow" {
|
||||
UseLayoutRounding: true
|
||||
WindowStartupLocation: CenterScreen
|
||||
|
||||
DialogHost {
|
||||
DockPanel {
|
||||
IsEnabled: bind IsBusy
|
||||
convert (bool b) => b ? false : true
|
||||
Interaction.Triggers: [
|
||||
Interactivity.EventTrigger {
|
||||
EventName: "Loaded"
|
||||
InvokeCommandAction { Command: bind ViewLoadedCommand }
|
||||
},
|
||||
Interactivity.EventTrigger {
|
||||
EventName: "Closed"
|
||||
InvokeCommandAction { Command: bind ViewClosedCommand }
|
||||
}
|
||||
]
|
||||
|
||||
DialogHost {
|
||||
SnackbarMessageQueue: bind MessageQueue from "Snackbar"
|
||||
|
||||
DockPanel {
|
||||
// Toolbar
|
||||
Border {
|
||||
DockPanel.Dock: Top
|
||||
Background: resource dyn "PrimaryHueMidBrush"
|
||||
IsEnabled: bind IsBusy
|
||||
convert (bool b) => b ? false : true
|
||||
TextElement.Foreground: resource dyn "SecondaryInverseTextBrush"
|
||||
StackPanel {
|
||||
Grid {
|
||||
@@ -104,6 +117,8 @@ Window "DiscordChatExporter.Gui.Views.MainWindow" {
|
||||
Grid {
|
||||
DockPanel {
|
||||
Background: resource dyn "MaterialDesignCardBackground"
|
||||
IsEnabled: bind IsBusy
|
||||
convert (bool b) => b ? false : true
|
||||
Visibility: bind IsDataAvailable
|
||||
convert (bool b) => b ? Visibility.Visible : Visibility.Hidden
|
||||
|
||||
@@ -265,6 +280,10 @@ Window "DiscordChatExporter.Gui.Views.MainWindow" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Snackbar
|
||||
Snackbar "Snackbar" {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using DiscordChatExporter.Gui.Messages;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
@@ -13,7 +14,13 @@ namespace DiscordChatExporter.Gui.Views
|
||||
InitializeComponent();
|
||||
Title += $" v{Assembly.GetExecutingAssembly().GetName().Version}";
|
||||
|
||||
// Dialogs
|
||||
Snackbar.MessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(5));
|
||||
|
||||
// Notification messages
|
||||
Messenger.Default.Register<ShowNotificationMessage>(this,
|
||||
m => Snackbar.MessageQueue.Enqueue(m.Message, m.CallbackCaption, m.Callback));
|
||||
|
||||
// Dialog messages
|
||||
Messenger.Default.Register<ShowErrorMessage>(this,
|
||||
m => DialogHost.Show(new ErrorDialog()).Forget());
|
||||
Messenger.Default.Register<ShowExportDoneMessage>(this,
|
||||
|
||||
Reference in New Issue
Block a user