diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs index e5733c8e2..d9ad40690 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs @@ -15,7 +15,7 @@ namespace Artemis.Core /// /// /// The type of property encapsulated in this layer property - public class LayerProperty : ILayerProperty + public class LayerProperty : CorePropertyChanged, ILayerProperty { private bool _disposed; @@ -265,6 +265,7 @@ namespace Artemis.Core _baseValue = value; ReapplyUpdate(); + OnPropertyChanged(nameof(BaseValue)); } } diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertyGroupViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertyGroupViewModel.cs index f0cb27d88..84e28c8a3 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertyGroupViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertyGroupViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using Artemis.Core; using Artemis.UI.Ninject.Factories; @@ -17,6 +18,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties private bool _isVisible; private TreeGroupViewModel _treeGroupViewModel; private TimelineGroupViewModel _timelineGroupViewModel; + private bool _hasChildren; public LayerPropertyGroupViewModel(LayerPropertyGroup layerPropertyGroup, IProfileEditorService profileEditorService, ILayerPropertyVmFactory layerPropertyVmFactory) { @@ -62,6 +64,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties } } + public bool HasChildren + { + get => _hasChildren; + set => SetAndNotify(ref _hasChildren, value); + } protected override void OnInitialActivate() { @@ -169,6 +176,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties Items.Add(_layerPropertyVmFactory.LayerPropertyGroupViewModel(value)); } } + + HasChildren = Items.Any(i => i is LayerPropertyViewModel {IsVisible: true} || i is LayerPropertyGroupViewModel {IsVisible: true}); } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupView.xaml index e80ebe39e..2ab3fc453 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupView.xaml @@ -33,6 +33,7 @@ Foreground="{DynamicResource MaterialDesignBody}" Style="{StaticResource MaterialDesignExpandCollapseToggleStyle}" IsChecked="{Binding Path=LayerPropertyGroupViewModel.IsExpanded}" + Visibility="{Binding Path=LayerPropertyGroupViewModel.HasChildren, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}" ClickMode="Press" /> @@ -121,17 +122,39 @@ ToolTip="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Description}" Margin="0 5 0 0" /> - + + Extra options available! + + + + + + + + + + + + + + + + + + + + +