This commit is contained in:
2022-06-09 17:49:34 +02:00
parent 9d48caaa58
commit 0b3fe30fec
24 changed files with 254 additions and 34 deletions

View File

@@ -10,7 +10,6 @@ public interface IGuiAppState : IAppState
List<KeyConfig> PreviousKeys { get; }
bool IsAllShortcutVisible { get; set; }
bool NoCommandFound { get; set; }
string? MessageBoxText { get; set; }
List<CommandBindingConfiguration> PossibleCommands { get; set; }
BindedCollection<RootDriveInfo, string> RootDriveInfos { get; set; }
IReadOnlyList<PlaceInfo> Places { get; set; }

View File

@@ -0,0 +1,31 @@
using FileTime.App.Core.ViewModels;
using FileTime.Core.Interactions;
using MvvmGen;
namespace FileTime.GuiApp.ViewModels;
[ViewModel]
public partial class MessageBoxViewModel : IModalViewModel
{
private readonly Action<MessageBoxViewModel, MessageBoxResult> _handler;
public string Text { get; }
public string Name => "MessageBoxViewModel";
public MessageBoxViewModel(string text, Action<MessageBoxViewModel, MessageBoxResult> handler)
{
_handler = handler;
Text = text;
}
[Command]
public void Ok()
{
_handler.Invoke(this, MessageBoxResult.Ok);
}
[Command]
public void Cancel()
{
_handler.Invoke(this, MessageBoxResult.Cancel);
}
}

View File

@@ -7,7 +7,7 @@ namespace FileTime.GuiApp.ViewModels;
[ViewModel]
[Inject(typeof(Action<ReadInputsViewModel>), "_cancel")]
[Inject(typeof(Action<ReadInputsViewModel>), "_process")]
public partial class ReadInputsViewModel : IModalViewModelBase
public partial class ReadInputsViewModel : IModalViewModel
{
public string Name => "ReadInputs";
public List<IInputElement> Inputs { get; set; }