So i have something along the lines of
private ObservableCollection<ViewModel> _internal;
public ObservableCollection<ViewModel> BoundInternal{get;set}; //this is Binded in the Itemssource like ItemSource={Binding BoundInternal}
Now In my code i do something like
BoundInternal=_internal, However the problem is the BoundInternal isn’t trigger any collectionChanged event. I have to use the Add method. So I am wondering if there is a solution to this.
Here is what I suspect your code ought to look like like (although its not quite a match for what you currently doing):-
In this case the
_internalfield becomes the source of the value ofBoundInternaldirectly and you should only assign it viaBoundInternal, (don’t assign a value directly to_internal). When that occurs anything currently bound to it will be informed of the change.If for some reason you really do need to maintain
_internalas a separate reference from the backing field ofBoundInternalthen:-Now at some point in your code when you do
BoundInternal = _internal, anything bound to it will be informed of the change.