today I found a big showstopper for my programming.
There is a class
class Foo
{
classA property {get; set;}
classB property {get; set;}
classC property {get; set;}
}
And each of the classes A, B and C has svereal classes as properties too. So, my class Foo is quite nested. The claas Foo passes parameters to an option window which is opened by the ShowDialog() command.
ShowDialog() result false -> SelectedFoo = backup / result true -> leave method
So if the user cancels the option window the SelectedFoo, which was passed to the ViewModel of the SettingsWindow gets replaced by the backup. Well, in theory. The classes are all reference type and changed duo to the data binding in MVVM. So my backup gets altered too.
How can I stop that behaviour? Is there some way to break the connection between these two classes?