2 changed files with 64 additions and 59 deletions
@ -1,57 +1,55 @@ |
|||||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||||
|
|
||||||
using System; |
using System; |
||||||
using System.Windows; |
using System.Windows; |
||||||
using System.Windows.Controls; |
using System.Windows.Controls; |
||||||
|
|
||||||
using ICSharpCode.Core; |
using ICSharpCode.Core; |
||||||
using ICSharpCode.SharpDevelop; |
using ICSharpCode.SharpDevelop; |
||||||
using ICSharpCode.SharpDevelop.Gui; |
using ICSharpCode.SharpDevelop.Gui; |
||||||
using ICSharpCode.WpfDesign.Designer.ThumbnailView; |
using ICSharpCode.WpfDesign.Designer.ThumbnailView; |
||||||
|
|
||||||
namespace ICSharpCode.WpfDesign.AddIn |
namespace ICSharpCode.WpfDesign.AddIn |
||||||
{ |
{ |
||||||
|
public class ThumbnailViewPad : AbstractPadContent |
||||||
public class ThumbnailViewPad : AbstractPadContent |
|
||||||
{ |
{ |
||||||
ContentPresenter contentControl = new ContentPresenter(); |
ContentPresenter contentControl = new ContentPresenter(); |
||||||
|
|
||||||
|
ThumbnailView thumbnailView = new ThumbnailView(); |
||||||
|
|
||||||
|
TextBlock notAvailableTextBlock = new TextBlock { |
||||||
|
Text = StringParser.Parse("${res:ICSharpCode.SharpDevelop.Gui.OutlinePad.NotAvailable}"), |
||||||
|
TextWrapping = TextWrapping.Wrap |
||||||
|
}; |
||||||
|
|
||||||
|
public ThumbnailViewPad() |
||||||
|
{ |
||||||
|
WorkbenchSingleton.Workbench.ActiveViewContentChanged += WorkbenchActiveViewContentChanged; |
||||||
|
WorkbenchActiveViewContentChanged(null, null); |
||||||
|
} |
||||||
|
|
||||||
ThumbnailView thumbnailView = new ThumbnailView(); |
void WorkbenchActiveViewContentChanged(object sender, EventArgs e) |
||||||
|
{ |
||||||
TextBlock notAvailableTextBlock = new TextBlock { |
|
||||||
Text = StringParser.Parse("${res:ICSharpCode.SharpDevelop.Gui.OutlinePad.NotAvailable}"), |
|
||||||
TextWrapping = TextWrapping.Wrap |
|
||||||
}; |
|
||||||
|
|
||||||
public ThumbnailViewPad() |
|
||||||
{ |
|
||||||
WorkbenchSingleton.Workbench.ActiveViewContentChanged += WorkbenchActiveViewContentChanged; |
|
||||||
WorkbenchActiveViewContentChanged(null, null); |
|
||||||
} |
|
||||||
|
|
||||||
void WorkbenchActiveViewContentChanged(object sender, EventArgs e) |
|
||||||
{ |
|
||||||
WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent; |
WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent; |
||||||
if (wpfView != null) |
if (wpfView != null) |
||||||
{ |
{ |
||||||
thumbnailView.DesignSurface = wpfView.DesignSurface; |
thumbnailView.DesignSurface = wpfView.DesignSurface; |
||||||
contentControl.SetContent(thumbnailView); |
contentControl.SetContent(thumbnailView); |
||||||
} |
} |
||||||
else |
else |
||||||
{ |
{ |
||||||
|
contentControl.SetContent(notAvailableTextBlock); |
||||||
contentControl.SetContent(notAvailableTextBlock); |
} |
||||||
} |
} |
||||||
} |
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
||||||
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
/// </summary>
|
||||||
/// </summary>
|
public override object Control { |
||||||
public override object Control { |
get { |
||||||
get { |
return contentControl; |
||||||
return contentControl; |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
|
||||||
|
Loading…
Reference in new issue