I have a WPF application in which I have overridden the OnClosing event so I do the following code:
protected override void OnClosing(CancelEventArgs e)
{
this.Visibility = Visibility.Collapsed;
e.Cancel = true;
}
so I can close and show the window again whenever I want. Also, the corresponding ViewModel is created once and when the window shows up again the binding works perfectly but the problem is when the window is closed and I update the ViewModel of the window and then I show the window again the bindings work perfectly but has a little delay which means I see the window first loads and then fields will be updated based on the updated value of the ViewModel when the window was closed. I'm looking for a solution to eliminate this delay so the window opens right away with the updated value