The below post was quite informative about the passing reference types. However, I now have a practical question of getting around this behaviour. I am passing a DataTable to a second window with the below code;
Window2.LoadedTblData = _loadedTblData;
Once this has been passed I would like the user to continue to be able to use Window1 (which means manipulating _loadedTblData
) without impacting the data in Window2. I.e. I want to pass the table by value, not by reference. How would I do this?
Why is list when passed without ref to a function acting like passed with ref?