Files
Artemis/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyTreeChildViewModel.cs
T
2020-01-09 16:56:46 +01:00

28 lines
1.1 KiB
C#

using Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput;
namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree
{
public class PropertyTreeChildViewModel : PropertyTreeItemViewModel
{
public PropertyTreeChildViewModel(LayerPropertyViewModel layerPropertyViewModel)
{
LayerPropertyViewModel = layerPropertyViewModel;
PropertyInputViewModel = layerPropertyViewModel.GetPropertyInputViewModel();
}
public LayerPropertyViewModel LayerPropertyViewModel { get; }
public PropertyInputViewModel PropertyInputViewModel { get; set; }
public override void Update(bool forceUpdate)
{
if (forceUpdate)
PropertyInputViewModel.Update();
else
{
// Only update if visible and if keyframes are enabled
if (LayerPropertyViewModel.Parent.IsExpanded && LayerPropertyViewModel.KeyframesEnabled)
PropertyInputViewModel.Update();
}
}
}
}