mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-15 19:32:31 +00:00
[GUI] Show error in a dialog when pull or export fails, instead of crashing the whole app
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using DiscordChatExporter.Gui.ViewModels.Framework;
|
||||
|
||||
namespace DiscordChatExporter.Gui.ViewModels.Dialogs
|
||||
{
|
||||
public class MessageBoxViewModel : DialogScreen
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
|
||||
public static class MessageBoxViewModelExtensions
|
||||
{
|
||||
public static MessageBoxViewModel CreateMessageBoxViewModel(
|
||||
this IViewModelFactory factory,
|
||||
string title,
|
||||
string message)
|
||||
{
|
||||
var viewModel = factory.CreateMessageBoxViewModel();
|
||||
|
||||
viewModel.Title = title;
|
||||
viewModel.Message = message;
|
||||
|
||||
return viewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user