diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs index c72c89f82..a24807ead 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs @@ -276,6 +276,9 @@ namespace Artemis.Core keyframe.LayerProperty = this; _keyframes.Add(keyframe); + if (!KeyframesEnabled) + KeyframesEnabled = true; + SortKeyframes(); OnKeyframeAdded(); } diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs index de21e2e59..06d87ef35 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs @@ -87,6 +87,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline private void UpdateKeyframes() { + NotifyOfPropertyChange(nameof(LayerProperty.KeyframesEnabled)); // Only show keyframes if they are enabled if (LayerProperty.KeyframesEnabled) { diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs index e6c2ec2c4..212c23273 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs @@ -23,6 +23,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree LayerProperty.VisibilityChanged += LayerPropertyOnVisibilityChanged; LayerProperty.DataBindingEnabled += LayerPropertyOnDataBindingChange; LayerProperty.DataBindingDisabled += LayerPropertyOnDataBindingChange; + LayerProperty.KeyframesToggled += LayerPropertyOnKeyframesToggled; LayerPropertyViewModel.IsVisible = !LayerProperty.IsHidden; } @@ -100,6 +101,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree LayerProperty.VisibilityChanged -= LayerPropertyOnVisibilityChanged; LayerProperty.DataBindingEnabled -= LayerPropertyOnDataBindingChange; LayerProperty.DataBindingDisabled -= LayerPropertyOnDataBindingChange; + LayerProperty.KeyframesToggled -= LayerPropertyOnKeyframesToggled; } #endregion @@ -121,6 +123,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree NotifyOfPropertyChange(nameof(HasDataBinding)); } + private void LayerPropertyOnKeyframesToggled(object sender, LayerPropertyEventArgs e) + { + NotifyOfPropertyChange(nameof(KeyframesEnabled)); + } + #endregion }