Profile editor - Added profile rename

Profile editor - Cleaned up buttons next to profile selection
This commit is contained in:
Robert committed 2020-12-17 21:09:42 +01:00
1 parent 3792dd53d2
commit e61a031485
8 files changed
+174 -56

No files matched your search

@@ -7,35 +7,44 @@ namespace Artemis.Core
/// <summary>
/// Represents a descriptor that describes a profile
/// </summary>
public class ProfileDescriptor
public class ProfileDescriptor : CorePropertyChanged
{
private readonly ProfileEntity _profileEntity;
internal ProfileDescriptor(ProfileModule profileModule, ProfileEntity profileEntity)
{
_profileEntity = profileEntity;
ProfileModule = profileModule;
Id = profileEntity.Id;
Name = profileEntity.Name;
IsLastActiveProfile = profileEntity.IsActive;
}
/// <summary>
/// Gets a boolean indicating whether this was the last active profile
/// </summary>
public bool IsLastActiveProfile { get; }
/// <summary>
/// Gets the unique ID of the profile by which it can be loaded from storage
/// </summary>
public Guid Id { get; }
/// <summary>
/// Gets the module backing the profile
/// </summary>
public ProfileModule ProfileModule { get; }
/// <summary>
/// Gets the unique ID of the profile by which it can be loaded from storage
/// </summary>
public Guid Id => _profileEntity.Id;
/// <summary>
/// Gets the name of the profile
/// </summary>
public string Name { get; }
public string Name => _profileEntity.Name;
/// <summary>
/// Gets a boolean indicating whether this was the last active profile
/// </summary>
public bool IsLastActiveProfile => _profileEntity.IsActive;
/// <summary>
/// Triggers a property change for all properties linked to the backing profile entity ¯\_(ツ)_/¯
/// </summary>
public void Update()
{
OnPropertyChanged(nameof(Id));
OnPropertyChanged(nameof(Name));
OnPropertyChanged(nameof(IsLastActiveProfile));
}
}
}