|
|
|
@ -126,8 +126,6 @@ namespace ICSharpCode.WpfDesign.Designer |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void UnloadDesigner() |
|
|
|
public void UnloadDesigner() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(_focusNav!=null) |
|
|
|
|
|
|
|
_focusNav.End(); |
|
|
|
|
|
|
|
if (_designContext != null) { |
|
|
|
if (_designContext != null) { |
|
|
|
foreach (object o in _designContext.Services.AllServices) { |
|
|
|
foreach (object o in _designContext.Services.AllServices) { |
|
|
|
IDisposable d = o as IDisposable; |
|
|
|
IDisposable d = o as IDisposable; |
|
|
|
@ -175,10 +173,12 @@ namespace ICSharpCode.WpfDesign.Designer |
|
|
|
public bool CanCopyOrCut() |
|
|
|
public bool CanCopyOrCut() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ISelectionService selectionService = GetService<ISelectionService>(); |
|
|
|
ISelectionService selectionService = GetService<ISelectionService>(); |
|
|
|
|
|
|
|
if(selectionService!=null){ |
|
|
|
if (selectionService.SelectedItems.Count == 0) |
|
|
|
if (selectionService.SelectedItems.Count == 0) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
if (selectionService.SelectedItems.Count == 1 && selectionService.PrimarySelection == DesignContext.RootItem) |
|
|
|
if (selectionService.SelectedItems.Count == 1 && selectionService.PrimarySelection == DesignContext.RootItem) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -218,7 +218,7 @@ namespace ICSharpCode.WpfDesign.Designer |
|
|
|
public bool CanPaste() |
|
|
|
public bool CanPaste() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ISelectionService selection = _designContext.Services.Selection; |
|
|
|
ISelectionService selection = _designContext.Services.Selection; |
|
|
|
if(selection.SelectedItems.Count!=0){ |
|
|
|
if(selection!=null && selection.SelectedItems.Count!=0){ |
|
|
|
string xaml = Clipboard.GetText(TextDataFormat.Xaml); |
|
|
|
string xaml = Clipboard.GetText(TextDataFormat.Xaml); |
|
|
|
if(xaml != "" && xaml != " ") |
|
|
|
if(xaml != "" && xaml != " ") |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|