mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Effects - Added effects UI, order is still a bit messed up and reordering is missed Effects - Added renaming of effects on the layer
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System.Threading.Tasks;
|
|
using Artemis.Core.Models.Profile;
|
|
using Artemis.UI.Shared.Services.Dialog;
|
|
using FluentValidation;
|
|
using Stylet;
|
|
|
|
namespace Artemis.UI.Screens.Module.ProfileEditor.Dialogs
|
|
{
|
|
public class RenameViewModel : DialogViewModelBase
|
|
{
|
|
public RenameViewModel(IModelValidator<RenameViewModel> validator, string subject, string currentName) : base(validator)
|
|
{
|
|
Subject = subject;
|
|
ElementName = currentName;
|
|
}
|
|
|
|
public string Subject { get; }
|
|
public string ElementName { get; set; }
|
|
|
|
public async Task Accept()
|
|
{
|
|
await ValidateAsync();
|
|
|
|
if (HasErrors)
|
|
return;
|
|
|
|
Session.Close(ElementName);
|
|
}
|
|
|
|
public void Cancel()
|
|
{
|
|
Session.Close();
|
|
}
|
|
}
|
|
|
|
public class ProfileElementRenameViewModelValidator : AbstractValidator<RenameViewModel>
|
|
{
|
|
public ProfileElementRenameViewModelValidator()
|
|
{
|
|
RuleFor(m => m.ElementName).NotEmpty().WithMessage("Element name may not be empty");
|
|
}
|
|
}
|
|
} |