Implement auto-update via Onova

This commit is contained in:
Alexey Golub
2018-02-25 17:00:44 +02:00
parent 7bfd645e8e
commit 63c835df88
11 changed files with 187 additions and 22 deletions

View File

@@ -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" {
}
}
}
}

View File

@@ -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,