ObservableCollection<T>.Clear() does not raise propertychanged event? #1070
-
when i execute the .Clear() method of a observablecollection (in my case ObservableCollection) it does not raise the propertychangedevent. is this because of the datatype drawingline?
thanks for help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solution: ObservableCollection.Clear() does not raise propertychanged event. If you want the popertychanged event to be raised, you need to option 2: Just in case somebody is wondering. greetings |
Beta Was this translation helpful? Give feedback.
Solution:
ObservableCollection.Clear() does not raise propertychanged event.
If you want the popertychanged event to be raised, you need to
option 1:
create a new object and "overwrite" the existing variable value
var collection = new ObersvableCollection<IDrawingLine>();
option 2:
Call OnPropertyChanged manually
OnPropertyChanged(nameof(collection))
Just in case somebody is wondering.
greetings