mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Added folder/layer renaming
Implemented profile saving
This commit is contained in:
1 parent
d8b0b2d4b6
commit
75e932edb1
20 files changed
+253
-62
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Models.Profile.Abstract;
|
||||
using Artemis.UI.ViewModels.Dialogs;
|
||||
using FluentValidation;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Module.ProfileEditor.Dialogs
|
||||
{
|
||||
public class ProfileElementRenameViewModel : DialogViewModelBase
|
||||
{
|
||||
public ProfileElementRenameViewModel(IModelValidator<ProfileElementRenameViewModel> validator, ProfileElement profileElement) : base(validator)
|
||||
{
|
||||
ElementName = profileElement.Name;
|
||||
}
|
||||
|
||||
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<ProfileElementRenameViewModel>
|
||||
{
|
||||
public ProfileElementRenameViewModelValidator()
|
||||
{
|
||||
RuleFor(m => m.ElementName).NotEmpty().WithMessage("Element name may not be empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user