Brushes - Allow hiding of properties

This commit is contained in:
SpoinkyNL committed 2020-04-21 14:05:30 +02:00
1 parent 8c0d62a00b
commit 5bbd4c7df5
8 files changed
+113 -47

No files matched your search

@@ -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
}
}