@@ -13,10 +13,6 @@ namespace Stride.Core.Presentation.ViewModels;
1313/// </summary>
1414public abstract class ViewModelBase : INotifyPropertyChanging , INotifyPropertyChanged , IDestroyable
1515{
16- #if DEBUG
17- private readonly List < string > changingProperties = [ ] ;
18- #endif
19-
2016 /// <summary>
2117 /// A collection of property names that are dependent. For each entry of this collection, if the key property name is notified
2218 /// as being changed, then the property names in the value will also be notified as being changed.
@@ -239,13 +235,6 @@ protected virtual void OnPropertyChanging(params string[] propertyNames)
239235
240236 foreach ( var propertyName in propertyNames )
241237 {
242- #if DEBUG
243- if ( changingProperties . Contains ( propertyName ) )
244- throw new InvalidOperationException ( $ "OnPropertyChanging called twice for property '{ propertyName } ' without invoking OnPropertyChanged between calls.") ;
245-
246- changingProperties . Add ( propertyName ) ;
247- #endif
248-
249238 propertyChanging ? . Invoke ( this , new PropertyChangingEventArgs ( propertyName ) ) ;
250239
251240 if ( DependentProperties . TryGetValue ( propertyName , out var dependentProperties ) )
@@ -274,13 +263,6 @@ protected virtual void OnPropertyChanged(params string[] propertyNames)
274263 OnPropertyChanged ( reverseList ) ;
275264 }
276265 propertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
277-
278- #if DEBUG
279- if ( ! changingProperties . Contains ( propertyName ) )
280- throw new InvalidOperationException ( $ "OnPropertyChanged called for property '{ propertyName } ' but OnPropertyChanging was not invoked before.") ;
281-
282- changingProperties . Remove ( propertyName ) ;
283- #endif
284266 }
285267 }
286268
0 commit comments