///<summary> Открыть карточку контакта </summary> private void OpenModelContactDetail(ModelContact modelContact) { if (modelContact == null) { return; } var userControl = WindowMain.GetRightWorkspaceContent(); if (userControl != null && (userControl as ViewContactDetail)?.CurrentModelContact.Id == modelContact.Id) { var userControlFront = WindowMain.GetRightWorkspaceFrontContent(); // проверить на null и попробовать привести к ViewCallActive if (userControlFront != null && userControlFront is ViewCallActive) { WindowMain.CloseInRightWorkspaceFront(); } return; } WindowMain.ShowInRightWorkspace(new ViewContactDetail(modelContact)); }
/// <summary> Обработчик события CloseView </summary> private void ViewModelCallActiveOnCloseView(object sender, EventArgs eventArgs) { WindowMain.CloseInRightWorkspaceFront(); _viewModelCallActive.Dispose(); }