1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
SpoinkyNL 3ec90766aa UI - Implemented tray icon
UI - Moved dialog service to the shared UI project
UI - Implemented autorun
2020-02-23 12:37:30 +01:00

39 lines
959 B
C#

using System.Threading.Tasks;
using Artemis.UI.Shared.Services.Dialog;
using FluentValidation;
using Stylet;
namespace Artemis.UI.Screens.Module.ProfileEditor.Dialogs
{
public class ProfileCreateViewModel : DialogViewModelBase
{
public ProfileCreateViewModel(IModelValidator<ProfileCreateViewModel> validator) : base(validator)
{
}
public string ProfileName { get; set; }
public async Task Accept()
{
await ValidateAsync();
if (HasErrors)
return;
Session.Close(ProfileName);
}
public void Cancel()
{
Session.Close();
}
}
public class ProfileCreateViewModelValidator : AbstractValidator<ProfileCreateViewModel>
{
public ProfileCreateViewModelValidator()
{
RuleFor(m => m.ProfileName).NotEmpty().WithMessage("Profile name may not be empty");
}
}
}