Browse Source

Thumbnail View in WPF Designer Addin

pull/52/head
jkuehner 13 years ago
parent
commit
7e7bacccb3
  1. 57
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ThumbnailViewPad.cs
  2. 7
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
  3. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.addin

57
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ThumbnailViewPad.cs

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
// 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)
using System;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.WpfDesign.Designer.ThumbnailView;
namespace ICSharpCode.WpfDesign.AddIn
{
public class ThumbnailViewPad : AbstractPadContent
{
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);
}
void WorkbenchActiveViewContentChanged(object sender, EventArgs e)
{
WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent;
if (wpfView != null)
{
thumbnailView.DesignSurface = wpfView.DesignSurface;
contentControl.SetContent(thumbnailView);
}
else
{
contentControl.SetContent(notAvailableTextBlock);
}
}
/// <summary>
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
/// </summary>
public override object Control {
get {
return contentControl;
}
}
}
}

7
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj

@ -68,6 +68,7 @@ @@ -68,6 +68,7 @@
<Compile Include="Src\Commands\Remove.cs" />
<Compile Include="Src\Commands\UndoRedo.cs" />
<Compile Include="Src\Commands\ViewXaml.cs" />
<Compile Include="Src\ThumbnailViewPad.cs" />
<Compile Include="Src\CSharpEventHandlerService.cs" />
<Compile Include="Src\FileUriContext.cs" />
<Compile Include="Src\IdeChooseClassService.cs" />
@ -152,9 +153,5 @@ @@ -152,9 +153,5 @@
<Page Include="Src\ImageSourceEditor\ImageSourceEditor.xaml" />
<Page Include="Src\ObjectEditor.xaml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images" />
<Folder Include="Src\ImageSourceEditor" />
<Folder Include="Src\Commands" />
</ItemGroup>
<ItemGroup />
</Project>

8
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.addin

@ -23,6 +23,14 @@ @@ -23,6 +23,14 @@
title = "WPF designer"/>-->
<DisplayBinding id="WPFDesigner" type="Secondary" class="ICSharpCode.WpfDesign.AddIn.WpfSecondaryDisplayBinding" fileNamePattern="\.xaml$" />
</Path>
<Path name = "/SharpDevelop/Workbench/Pads">
<Pad id = "ThumbnailViewPad"
category = "Main"
title = "${res:ICSharpCode.WpfDesign.AddIn.ThumbnailViewPad}"
icon = "PadIcons.Toolbar"
class = "ICSharpCode.WpfDesign.AddIn.ThumbnailViewPad"
defaultPosition = "Right, Hidden" />
</Path>
<!--
<Path name = "/SharpDevelop/Workbench/Pads">
<Pad id = "OutlineViewPad"

Loading…
Cancel
Save