Hello,
I was not sure where to post this question. We are using a CAB architecture application. And in the main form there is a link , clicking on it will open a popup in a new workspace.
Following code does that.
public T ShowWindowsWorkspaceViewModal<T>(object source, EventArgs args, string id, ISmartPartInfo smartPartInfo)
{
WindowWorkspaceExtended wspext = (WindowWorkspaceExtended)this.WorkItem.Workspaces["ModalWindowWorkspace"];
if (wspext.ActiveSmartPart != null && wspext.SmartParts.Contains(wspext.ActiveSmartPart))
wspext.Close(wspext.ActiveSmartPart);
}
// Get workspace
T showView = this.WorkItem.Items.Get<T>(id);
if (showView == null)
showView = this.WorkItem.Items.AddNew<T>(id);
if (smartPartInfo == null)
wspext.Show(showView);
else
wspext.Show(showView, smartPartInfo);
return showView;
Now once the pop is opened. I wanted to know if there is way to close this pop up by clicking a button on the pop up itself ?
Hoping for some help...
You should be able to close the pop-up the same way you would close any form. Just place a button on the pop-up and call this.close(); in the button's click event.