mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Brushes - Allow hiding of properties
This commit is contained in:
1 parent
8c0d62a00b
commit
5bbd4c7df5
8 files changed
+113
-47
No files matched your search
+22
-1
@@ -14,6 +14,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
private readonly IKernel _kernel;
|
||||
private readonly IProfileEditorService _profileEditorService;
|
||||
private bool _keyframesEnabled;
|
||||
private bool _isExpanded;
|
||||
|
||||
public LayerPropertyViewModel(BaseLayerProperty layerProperty, LayerPropertyViewModel parent, IKernel kernel, IProfileEditorService profileEditorService)
|
||||
{
|
||||
@@ -34,7 +35,15 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
public LayerPropertyViewModel Parent { get; }
|
||||
public List<LayerPropertyViewModel> Children { get; }
|
||||
|
||||
public bool IsExpanded { get; set; }
|
||||
public bool IsExpanded
|
||||
{
|
||||
get => _isExpanded;
|
||||
set
|
||||
{
|
||||
_isExpanded = value;
|
||||
OnExpandedStateChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool KeyframesEnabled
|
||||
{
|
||||
@@ -75,5 +84,17 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<EventArgs> ExpandedStateChanged;
|
||||
protected virtual void OnExpandedStateChanged()
|
||||
{
|
||||
ExpandedStateChanged?.Invoke(this, EventArgs.Empty);
|
||||
foreach (var layerPropertyViewModel in Children)
|
||||
layerPropertyViewModel.OnExpandedStateChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user