TextBox, PropertyChangeHandler

This commit is contained in:
2023-08-11 21:51:44 +02:00
parent e989a65e81
commit 1fde0df2d6
81 changed files with 1539 additions and 390 deletions

View File

@@ -1,5 +1,4 @@
using System.Reactive.Linq;
using System.Reactive.Subjects;
using DeclarativeProperty;
using FileTime.App.CommandPalette.Models;
using FileTime.App.CommandPalette.ViewModels;
using FileTime.App.Core.Services;
@@ -11,8 +10,8 @@ public partial class CommandPaletteService : ICommandPaletteService
{
private readonly IModalService _modalService;
private readonly IIdentifiableUserCommandService _identifiableUserCommandService;
private readonly BehaviorSubject<bool> _showWindow = new(false);
IObservable<bool> ICommandPaletteService.ShowWindow => _showWindow.AsObservable();
private readonly DeclarativeProperty<bool> _showWindow = new(false);
IDeclarativeProperty<bool> ICommandPaletteService.ShowWindow => _showWindow;
[Notify] ICommandPaletteViewModel? _currentModal;
public CommandPaletteService(
@@ -24,13 +23,13 @@ public partial class CommandPaletteService : ICommandPaletteService
}
public void OpenCommandPalette()
{
_showWindow.OnNext(true);
_showWindow.SetValueSafe(true);
CurrentModal = _modalService.OpenModal<ICommandPaletteViewModel>();
}
public void CloseCommandPalette()
{
_showWindow.OnNext(false);
_showWindow.SetValueSafe(false);
if (_currentModal is not null)
{
_modalService.CloseModal(_currentModal);

View File

@@ -1,10 +1,9 @@
using System.Text;
using FileTime.App.CommandPalette.Services;
using FileTime.App.Core.Configuration;
using FileTime.App.CommandPalette.Services;
using FileTime.App.Core.Models;
using FileTime.App.Core.Services;
using FileTime.App.Core.ViewModels;
using FileTime.App.FuzzyPanel;
using GeneralInputKey;
using Microsoft.Extensions.Logging;
namespace FileTime.App.CommandPalette.ViewModels;