I have a WPF Application consisting of a MainWindow which also has a regular button inside. Bound to the button click event I am loading a serialized object via OpenFileDialog:
private void LoadNetwork_Click(object sender, RoutedEventArgs e)
{
var openDialog = new OpenFileDialog { Multiselect = false };
var result = openDialog.ShowDialog();
if (result)
{
string file = openDialog.FileName;
try
{
_network= new SimplifiedNetwork(file, 1);
MessageBox.Show("Loaded OK");
}
catch (Exception)
{
MessageBox.Show("Load error");
}
}
}
After this method gets executed the UI doesn't update anymore. And when I say nothing, I mean not even the hover effects on the buttons in the Window work (not to mention updating labels via code behind, property changed events, begin invokes etc.), it's like it's frozen (but still responsive to clicks).
I thought it was something I did inside my routines, but simply reducing the method call to
private void LoadNetwork_Click(object sender, RoutedEventArgs e)
{
var openDialog = new OpenFileDialog { Multiselect = false };
var result = openDialog.ShowDialog();
}
has the same result.
Clarification. -This occurs with after the Modal dialog is closed. -It also seems to manifest itself as soon as the UI loses focus for any reason (like minimize - restore, switch to another window). -This seems to occur only on my Windows 8.1 machine (put in an xp VM I have around, is OK).
Any ideas?