When assigning the Task property with a value, and binding the value with a delegate eventhandler. Does the value get selected for the GarbageCollection once a new value passes by? As per my understanding because the system does no longer have a reference to the old value, it gets flagged for garbage collection.
private ITask _task;
public ITask Task
{
get => _task;
private set
{
if(_task != value)
{
if(value != null)
value.PropertyChanged += (s, e) =>
{
if(((ITask)s).Status == TaskStatus.Ready)
RaisePropertyChanged(nameof(ButtonCommand));
};
_task = value;
RaisePropertyChanged();
}
}
}