mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Project - Cleaned up some test code
UI - Added scaffolding for databindings
This commit is contained in:
1 parent
47ba6fcf5e
commit
9e4ae9bbe1
28 files changed
+437
-453
No files matched your search
@@ -9,7 +9,6 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
{
|
||||
|
||||
public class TreePropertyViewModel<T> : TreePropertyViewModel
|
||||
{
|
||||
private readonly IProfileEditorService _profileEditorService;
|
||||
@@ -21,6 +20,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
_profileEditorService = profileEditorService;
|
||||
LayerPropertyViewModel = (LayerPropertyViewModel<T>) layerPropertyBaseViewModel;
|
||||
PropertyInputViewModel = propertyInputViewModel;
|
||||
|
||||
_profileEditorService.SelectedDataBindingChanged += ProfileEditorServiceOnSelectedDataBindingChanged;
|
||||
}
|
||||
|
||||
public LayerPropertyViewModel<T> LayerPropertyViewModel { get; }
|
||||
@@ -37,9 +38,10 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
set => ApplyKeyframesEnabled(value);
|
||||
}
|
||||
|
||||
public void OpenDataBindings()
|
||||
public bool DataBindingsOpen
|
||||
{
|
||||
_profileEditorService.ChangeSelectedDataBinding(LayerPropertyViewModel.BaseLayerProperty);
|
||||
get => _profileEditorService.SelectedDataBinding == LayerPropertyViewModel.BaseLayerProperty;
|
||||
set => _profileEditorService.ChangeSelectedDataBinding(value ? LayerPropertyViewModel.BaseLayerProperty : null);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
@@ -47,6 +49,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
PropertyInputViewModel.Dispose();
|
||||
}
|
||||
|
||||
private void ProfileEditorServiceOnSelectedDataBindingChanged(object sender, EventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(DataBindingsOpen));
|
||||
}
|
||||
|
||||
private void ApplyKeyframesEnabled(bool enable)
|
||||
{
|
||||
// If enabling keyframes for the first time, add a keyframe with the current value at the current position
|
||||
@@ -77,6 +84,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
}
|
||||
|
||||
public LayerPropertyBaseViewModel LayerPropertyBaseViewModel { get; }
|
||||
|
||||
public abstract void Dispose();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user