public void ShowDialog(string title, string Message, string screenID) { ScreenID = screenID; chkDontShow = false; CommonMessagingWindowVM.ProcessMiscellaneousMessages(Message, "Alert"); CustomMessageBox objcustwindow = Application.Current.Windows.OfType <CustomMessageBox>().FirstOrDefault(); if (objcustwindow != null) { Title = title; CapitalInfoMsg = Message; objcustwindow.Focus(); objcustwindow.Activate(); objcustwindow.ShowDialog(); } else { objcustwindow = new CustomMessageBox(); Title = title; CapitalInfoMsg = Message; objcustwindow.ShowDialog(); } }