When using an INotifyCollectionChanged (like ObservableCollection<T>), RadGridView's data engine subscribes to the CollectionChanged event of the bound collection.
It seems that the WPF views are recreated when you connect to a running remote desktop session or switch the user to a session where the corresponding WPF app is already opened. This creates new instances of all controls, but no unload or another disposal event happens. In this case, the logic that subscribes to the CollectionChanged event again is triggered for the new RadGridView, but the old one never detaches from the event. This causes a memory leak.
If you connect to the session multiple times, the CollectionChanged handler will be attached multiple times leading to a memory leak.
To work this around, set the ItemsSource of RadGridView to null in the SystemEvents.SessionChanged static event.
private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.SessionLock)
{
BindingOperations.ClearAllBindings(this.RadGridViewFixed);
}
}