private void OnDialogClosing(object sender, DialogClosingEventArgs eventargs)
 {
     if (!(bool)eventargs.Parameter)
     {
         return;
     }
     try
     {
         BoundWindow.Close(); //Close this window (Main)
     }
     catch
     {
         Log.Error("Could not close window properly");
     }
 }
 private void CloseWindow(object sender, RoutedEventArgs e)
 {
     if (CheckBeforeClose)
     {
         DialogHost.IsOpen = true;
     }
     else
     {
         try
         {
             BoundWindow.Close(); //Close this window (Main)
         }
         catch
         {
             Log.Error("Could not close window properly");
         }
     }
 }