2025-01-08 18:00:06 +03:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.ObjectModel;
|
2025-06-23 16:39:30 +03:00
|
|
|
using Nebula.Launcher.Services;
|
2025-01-08 18:00:06 +03:00
|
|
|
using Nebula.Launcher.Views.Popup;
|
2025-01-14 22:10:16 +03:00
|
|
|
using Nebula.Shared.Services;
|
2025-01-08 18:00:06 +03:00
|
|
|
|
2025-01-14 22:10:16 +03:00
|
|
|
namespace Nebula.Launcher.ViewModels.Popup;
|
2025-01-08 18:00:06 +03:00
|
|
|
|
2025-02-02 10:57:29 +03:00
|
|
|
[ViewModelRegister(typeof(ExceptionListView), false)]
|
2025-01-14 22:10:16 +03:00
|
|
|
[ConstructGenerator]
|
2025-02-02 10:57:29 +03:00
|
|
|
public sealed partial class ExceptionListViewModel : PopupViewModelBase
|
2025-01-08 18:00:06 +03:00
|
|
|
{
|
2025-01-14 22:10:16 +03:00
|
|
|
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
2025-06-23 16:39:30 +03:00
|
|
|
public override string Title => LocalisationService.GetString("popup-exception");
|
2025-01-12 15:15:01 +03:00
|
|
|
public override bool IsClosable => true;
|
2025-01-08 18:00:06 +03:00
|
|
|
|
|
|
|
|
public ObservableCollection<Exception> Errors { get; } = new();
|
|
|
|
|
|
2025-01-14 22:10:16 +03:00
|
|
|
protected override void Initialise()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void InitialiseInDesignMode()
|
|
|
|
|
{
|
|
|
|
|
var e = new Exception("TEST");
|
|
|
|
|
AppendError(e);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-08 18:00:06 +03:00
|
|
|
public void AppendError(Exception exception)
|
|
|
|
|
{
|
|
|
|
|
Errors.Add(exception);
|
2025-01-14 22:10:16 +03:00
|
|
|
if (exception.InnerException != null)
|
2025-01-08 18:00:06 +03:00
|
|
|
AppendError(exception.InnerException);
|
|
|
|
|
}
|
2025-01-14 22:10:16 +03:00
|
|
|
}
|