mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Editor - Fixed crash when moving folders due to a race condition
This commit is contained in:
parent
704d649fba
commit
2621542479
@ -111,7 +111,6 @@ public class PropertiesViewModel : ActivatableViewModelBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RenderProfileElement? ProfileElement => _profileElement?.Value;
|
public RenderProfileElement? ProfileElement => _profileElement?.Value;
|
||||||
public Layer? Layer => _profileElement?.Value as Layer;
|
|
||||||
public ILayerProperty? LayerProperty => _layerProperty?.Value;
|
public ILayerProperty? LayerProperty => _layerProperty?.Value;
|
||||||
public bool SuspendedEditing => _suspendedEditing?.Value ?? false;
|
public bool SuspendedEditing => _suspendedEditing?.Value ?? false;
|
||||||
|
|
||||||
@ -133,26 +132,27 @@ public class PropertiesViewModel : ActivatableViewModelBase
|
|||||||
|
|
||||||
private void UpdatePropertyGroups()
|
private void UpdatePropertyGroups()
|
||||||
{
|
{
|
||||||
if (ProfileElement == null)
|
RenderProfileElement? profileElement = ProfileElement;
|
||||||
|
if (profileElement == null)
|
||||||
{
|
{
|
||||||
PropertyGroupViewModels.Clear();
|
PropertyGroupViewModels.Clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObservableCollection<PropertyGroupViewModel> viewModels = new();
|
ObservableCollection<PropertyGroupViewModel> viewModels = new();
|
||||||
if (Layer != null)
|
if (profileElement is Layer layer)
|
||||||
{
|
{
|
||||||
// Add base VMs
|
// Add base VMs
|
||||||
viewModels.Add(GetOrCreatePropertyViewModel(Layer.General, null, null));
|
viewModels.Add(GetOrCreatePropertyViewModel(layer.General, null, null));
|
||||||
viewModels.Add(GetOrCreatePropertyViewModel(Layer.Transform, null, null));
|
viewModels.Add(GetOrCreatePropertyViewModel(layer.Transform, null, null));
|
||||||
|
|
||||||
// Add brush VM if the brush has properties
|
// Add brush VM if the brush has properties
|
||||||
if (Layer.LayerBrush?.BaseProperties != null)
|
if (layer.LayerBrush?.BaseProperties != null)
|
||||||
viewModels.Add(GetOrCreatePropertyViewModel(Layer.LayerBrush.BaseProperties, Layer.LayerBrush, null));
|
viewModels.Add(GetOrCreatePropertyViewModel(layer.LayerBrush.BaseProperties, layer.LayerBrush, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add effect VMs
|
// Add effect VMs
|
||||||
foreach (BaseLayerEffect layerEffect in ProfileElement.LayerEffects.OrderBy(e => e.Order))
|
foreach (BaseLayerEffect layerEffect in profileElement.LayerEffects.OrderBy(e => e.Order))
|
||||||
{
|
{
|
||||||
if (layerEffect.BaseProperties != null)
|
if (layerEffect.BaseProperties != null)
|
||||||
viewModels.Add(GetOrCreatePropertyViewModel(layerEffect.BaseProperties, null, layerEffect));
|
viewModels.Add(GetOrCreatePropertyViewModel(layerEffect.BaseProperties, null, layerEffect));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user