private IWorkspace GetViewWorkspace() { IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); IWorkspace workspace = locator.FindContainingWorkspace(WorkItem, View); return(workspace); }
protected virtual void CloseView() { IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); IWorkspace wks = locator.FindContainingWorkspace(WorkItem, View); if (wks != null) { wks.Close(View); } }
public void CloseOptionDetailView(object sender, EventArgs e) { IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); IWorkspace wks = locator.FindContainingWorkspace(WorkItem, sender); if (wks != null) { wks.Close(sender); } }
private IWorkspace GetViewWorkspace() { IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); if (locator != null) { return(locator.FindContainingWorkspace(WorkItem, View)); } return(null); }
private void CloseViewCommandExecutedEventHandler(object sender, ExecutedRoutedEventArgs e) { object smartPart = ((ContentControl)((FrameworkElement)((FrameworkElement)e.OriginalSource).Parent).TemplatedParent).Content; IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); IWorkspace workspace = locator.FindContainingWorkspace(WorkItem, smartPart); if (workspace != null) { workspace.Close(smartPart); } }
/// <summary> /// 关闭视图 /// </summary> protected virtual void CloseView() { IWorkspaceLocatorService locator = WorkItem.Services.Get <IWorkspaceLocatorService>(); if (locator != null) { IWorkspace wp = locator.FindContainingWorkspace(workItem, view); if (wp != null) { wp.Close(view); } } }