Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3335 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
6 changed files with 82 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Input; |
||||||
|
using ICSharpCode.WpfDesign.Designer.Services; |
||||||
|
|
||||||
|
namespace ICSharpCode.WpfDesign.Designer.Controls |
||||||
|
{ |
||||||
|
public class PanelMoveAdorner : Control |
||||||
|
{ |
||||||
|
static PanelMoveAdorner() |
||||||
|
{ |
||||||
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(PanelMoveAdorner), |
||||||
|
new FrameworkPropertyMetadata(typeof(PanelMoveAdorner))); |
||||||
|
} |
||||||
|
|
||||||
|
public PanelMoveAdorner(DesignItem item) |
||||||
|
{ |
||||||
|
this.item = item; |
||||||
|
} |
||||||
|
|
||||||
|
DesignItem item; |
||||||
|
|
||||||
|
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) |
||||||
|
{ |
||||||
|
e.Handled = true; |
||||||
|
new DragMoveMouseGesture(item, false).Start(item.Services.Tool.DesignPanel, e); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using ICSharpCode.WpfDesign.Adorners; |
||||||
|
using ICSharpCode.WpfDesign.Extensions; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows; |
||||||
|
using ICSharpCode.WpfDesign.Designer.Controls; |
||||||
|
|
||||||
|
namespace ICSharpCode.WpfDesign.Designer.Extensions |
||||||
|
{ |
||||||
|
[ExtensionFor(typeof(Panel))] |
||||||
|
[ExtensionServer(typeof(PrimarySelectionExtensionServer))] |
||||||
|
public class PanelMove : AdornerProvider |
||||||
|
{ |
||||||
|
protected override void OnInitialized() |
||||||
|
{ |
||||||
|
var adornerPanel = new AdornerPanel(); |
||||||
|
var adorner = new PanelMoveAdorner(ExtendedItem); |
||||||
|
AdornerPanel.SetPlacement(adorner, AdornerPlacement.FillContent); |
||||||
|
adornerPanel.Children.Add(adorner); |
||||||
|
Adorners.Add(adornerPanel); |
||||||
|
|
||||||
|
base.OnInitialized(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue