mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-13 04:18:51 +00:00
Data bindings - Fix crash when removing color gradient stops
This commit is contained in:
1 parent
91ad9b7bae
commit
eaa1f15ac3
5 files changed
+27
-2
No files matched your search
@@ -420,6 +420,14 @@ namespace Artemis.Core
|
||||
DataBindingRegistration<T, TProperty> registration = new(this, converter, getter, setter, displayName);
|
||||
_dataBindingRegistrations.Add(registration);
|
||||
|
||||
// If not yet initialized, load the data binding related to the registration if available
|
||||
if (_isInitialized)
|
||||
{
|
||||
IDataBinding? dataBinding = registration.CreateDataBinding();
|
||||
if (dataBinding != null)
|
||||
_dataBindings.Add(dataBinding);
|
||||
}
|
||||
|
||||
OnDataBindingPropertyRegistered();
|
||||
return registration;
|
||||
}
|
||||
@@ -432,7 +440,10 @@ namespace Artemis.Core
|
||||
if (_disposed)
|
||||
throw new ObjectDisposedException("LayerProperty");
|
||||
|
||||
foreach (IDataBindingRegistration dataBindingRegistration in _dataBindingRegistrations)
|
||||
dataBindingRegistration.ClearDataBinding();
|
||||
_dataBindingRegistrations.Clear();
|
||||
|
||||
OnDataBindingPropertiesCleared();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user