Hi guys!
I have a really weird thing happening in my wpf application.
Every time I close something (a dialog box, a window, etc...) the ENTIRE application closes, instead of only the window/dialog which is beeing closed.
This not only happens when I call the Close method directly, but also when the element closes on it's own, eg: when I click "OK" on a Dialog and it returns from the ShowDialog() method.
Also, this doesn't happen immediately, but only when the method in which the close event occourred. Here's an example to explain it better:
Public Sub addNewCanvas(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
Dim dlg As New addCanvasDgBox
Dim result As Nullable(Of Boolean) = dlg.ShowDialog
'The following if is executed, and so is the addCanvas() method
If (result = True) Then
addCanvas()
End If
End Sub
'Here comes the problem: efter the routine is ended instead of returning
'to the normal execution, the entire App.Run() method returns, closing the application
I really don't understand why this happens... no exceptions are raised, the output log or visualStudio have nothing to say, all variables are correctly valorized.
If any of you has any ideas, please let me know! It's driving me insane! Thanks in advance.
Master_T