views:

52

answers:

1

I have two windows, a main window an a window to update the database, the main window displays some data from the database. I have a private variable in main window that is connecting to DataGrid to pass the data, I need to update this private variable with information i entered in the update window. Should I try to access this data in the update window or how would I send a message from update to main to tell main to update it. If that's not clear I can elaborate more.

+1  A: 

for me.. i will choose the most natural and cleanest way.

if your update window can be a modal it would be better the main window access its property either then notified to update the data. it will win in automated testing case.

consider this on your main window:

if (updateWindow.ShowDialog() == true)
{
   MyUpdatedModel model = updateWindow.MyUpdatedData;
}
ktutnik
Ok, that works out. Thanks!
MCH