Console DialogService

This commit is contained in:
2023-08-14 11:50:59 +02:00
parent 6797c26bf9
commit 1f4b938358
41 changed files with 807 additions and 269 deletions

View File

@@ -21,7 +21,6 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler
private readonly IUserCommandHandlerService _userCommandHandlerService;
private readonly ILogger<RapidTravelModeKeyInputHandler> _logger;
private readonly IIdentifiableUserCommandService _identifiableUserCommandService;
private readonly BindedCollection<IModalViewModel> _openModals;
private ITabViewModel? _selectedTab;
public RapidTravelModeKeyInputHandler(
@@ -41,8 +40,6 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler
_appState.SelectedTab.Subscribe(t => _selectedTab = t);
_openModals = modalService.OpenModals.ToBindedCollection();
_appState.RapidTravelTextDebounced.Subscribe((v, _) =>
{
if (_selectedTab?.Tab is not { } tab) return Task.CompletedTask;
@@ -62,9 +59,9 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler
if (args.Key == Keys.Escape)
{
args.Handled = true;
if ((_openModals.Collection?.Count ?? 0) > 0)
if (_modalService.OpenModals.Count > 0)
{
_modalService.CloseModal(_openModals.Collection!.Last());
_modalService.CloseModal(_modalService.OpenModals.Last());
}
else
{