- tweak: file managment
This commit is contained in:
30
Nebula.Launcher/ViewModels/ExceptionViewModel.cs
Normal file
30
Nebula.Launcher/ViewModels/ExceptionViewModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Nebula.Launcher.ViewHelper;
|
||||
using Nebula.Launcher.Views.Popup;
|
||||
|
||||
namespace Nebula.Launcher.ViewModels;
|
||||
|
||||
[ViewModelRegister(typeof(ExceptionView), false)]
|
||||
public class ExceptionViewModel : PopupViewModelBase
|
||||
{
|
||||
public ExceptionViewModel() : base()
|
||||
{
|
||||
var e = new Exception("TEST");
|
||||
|
||||
AppendError(e);
|
||||
}
|
||||
|
||||
public ExceptionViewModel(IServiceProvider serviceProvider) : base(serviceProvider){}
|
||||
|
||||
public override string Title => "Oopsie! Some shit is happened now!";
|
||||
|
||||
public ObservableCollection<Exception> Errors { get; } = new();
|
||||
|
||||
public void AppendError(Exception exception)
|
||||
{
|
||||
Errors.Add(exception);
|
||||
if(exception.InnerException != null)
|
||||
AppendError(exception.InnerException);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user