I have a C#/WPF application that's running on Win 10 machine. I connect to the machine via RDP from a different Win 10 machine and setup some properties in the application, minimize it and close the RDP connection.
After a couple of minutes, I reconnect and maximize the application only to find all the settings I made reverted back to their default states. I found out that it's because the default constructor of the responsible class gets invoked and rewrites all the changed values back to their default values.
Edit: I found the same question here: WPF: Prevent unload & load after RDP (dis)connect
However, the solution from that question doesn't seem to be suitable for me as I need to keep the Loaded/Unloaded event handling intact. Is there perhaps some setting in the Remote Desktop Session Host configuration that would prevent this behavior? I tried setting the different Session Time Limits but it didn't seem to help.