2025-01-14 22:10:16 +03:00
|
|
|
using System;
|
|
|
|
|
using Nebula.Shared.Services;
|
|
|
|
|
|
|
|
|
|
namespace Nebula.Launcher.ViewModels.Popup;
|
|
|
|
|
|
|
|
|
|
public abstract class PopupViewModelBase : ViewModelBase, IDisposable
|
|
|
|
|
{
|
|
|
|
|
public abstract PopupMessageService PopupMessageService { get; }
|
|
|
|
|
|
|
|
|
|
public abstract string Title { get; }
|
|
|
|
|
public abstract bool IsClosable { get; }
|
2025-12-11 21:47:54 +03:00
|
|
|
public Action<PopupViewModelBase>? OnDisposing;
|
2025-01-14 22:10:16 +03:00
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
2025-08-17 21:02:45 +03:00
|
|
|
OnDispose();
|
2025-12-11 21:47:54 +03:00
|
|
|
OnDisposing?.Invoke(this);
|
2025-01-14 22:10:16 +03:00
|
|
|
PopupMessageService.ClosePopup(this);
|
|
|
|
|
}
|
2025-08-17 21:02:45 +03:00
|
|
|
|
|
|
|
|
protected virtual void OnDispose(){}
|
2025-01-14 22:10:16 +03:00
|
|
|
}
|