Skip to content

Commit 352d2dc

Browse files
author
tbulle
committed
Merge remote-tracking branch 'remotes/origin/master' into WpfDesignerPartialPanelSelectionHandler
2 parents aa59343 + b8ad8c5 commit 352d2dc

39 files changed

+1150
-384
lines changed
17.9 KB
Binary file not shown.
177 KB
Binary file not shown.

src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<Reference Include="System.Core" />
5555
<Reference Include="System.Design" />
5656
<Reference Include="System.Drawing" />
57+
<Reference Include="System.Drawing" />
5758
<Reference Include="System.Drawing.Design" />
5859
<Reference Include="System.Windows.Forms" />
5960
<Reference Include="System.Xaml">

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ResizeThumb.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static readonly DependencyProperty IsPrimarySelectionProperty
4545
public static readonly DependencyProperty ResizeThumbVisibleProperty
4646
= DependencyProperty.Register("ResizeThumbVisible", typeof(bool), typeof(ResizeThumb), new FrameworkPropertyMetadata(true));
4747

48-
internal PlacementAlignment Alignment;
48+
public PlacementAlignment Alignment;
4949

5050
static ResizeThumb()
5151
{

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/SizeDisplay.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@
2626

2727
namespace ICSharpCode.WpfDesign.Designer.Controls
2828
{
29-
/// <summary>
30-
/// Display height of the element.
31-
/// </summary>
32-
class HeightDisplay : Control
33-
{
34-
static HeightDisplay()
35-
{
36-
DefaultStyleKeyProperty.OverrideMetadata(typeof(HeightDisplay), new FrameworkPropertyMetadata(typeof(HeightDisplay)));
37-
}
38-
}
29+
/// <summary>
30+
/// Display height of the element.
31+
/// </summary>
32+
public class HeightDisplay : Control
33+
{
34+
static HeightDisplay()
35+
{
36+
DefaultStyleKeyProperty.OverrideMetadata(typeof(HeightDisplay), new FrameworkPropertyMetadata(typeof(HeightDisplay)));
37+
}
38+
}
3939

40-
/// <summary>
41-
/// Display width of the element.
42-
/// </summary>
43-
class WidthDisplay : Control
44-
{
45-
static WidthDisplay()
46-
{
47-
DefaultStyleKeyProperty.OverrideMetadata(typeof(WidthDisplay), new FrameworkPropertyMetadata(typeof(WidthDisplay)));
48-
}
49-
}
40+
/// <summary>
41+
/// Display width of the element.
42+
/// </summary>
43+
public class WidthDisplay : Control
44+
{
45+
static WidthDisplay()
46+
{
47+
DefaultStyleKeyProperty.OverrideMetadata(typeof(WidthDisplay), new FrameworkPropertyMetadata(typeof(WidthDisplay)));
48+
}
49+
}
5050
}

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ void RunHitTest(Visual reference, Point point, HitTestFilterCallback filterCallb
6464
HitTestFilterBehavior FilterHitTestInvisibleElements(DependencyObject potentialHitTestTarget)
6565
{
6666
UIElement element = potentialHitTestTarget as UIElement;
67-
67+
6868
if (element != null) {
6969
if (!(element.IsHitTestVisible && element.Visibility == Visibility.Visible)) {
7070
return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
7171
}
7272

7373
var designItem = Context.Services.Component.GetDesignItem(element) as XamlDesignItem;
74-
74+
7575
if (designItem != null && designItem.IsDesignTimeLocked) {
7676
return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
7777
}
@@ -109,14 +109,17 @@ public void HitTest(Point mousePosition, bool testAdorners, bool testDesignSurfa
109109
return;
110110
}
111111
// First try hit-testing on the adorner layer.
112-
112+
113113
bool continueHitTest = true;
114-
114+
115+
HitTestFilterCallback filterBehavior = CustomHitTestFilterBehavior ?? FilterHitTestInvisibleElements;
116+
CustomHitTestFilterBehavior = null;
115117
hitTestElements.Clear();
116118

117119
if (testAdorners) {
120+
118121
RunHitTest(
119-
_adornerLayer, mousePosition, FilterHitTestInvisibleElements,
122+
_adornerLayer, mousePosition, filterBehavior,
120123
delegate(HitTestResult result) {
121124
if (result != null && result.VisualHit != null && result.VisualHit is Visual) {
122125
DesignPanelHitTestResult customResult = new DesignPanelHitTestResult((Visual)result.VisualHit);
@@ -138,11 +141,11 @@ public void HitTest(Point mousePosition, bool testAdorners, bool testDesignSurfa
138141

139142
if (continueHitTest && testDesignSurface) {
140143
RunHitTest(
141-
this.Child, mousePosition, FilterHitTestInvisibleElements,
144+
this.Child, mousePosition, filterBehavior,
142145
delegate(HitTestResult result) {
143146
if (result != null && result.VisualHit != null && result.VisualHit is Visual) {
144147
DesignPanelHitTestResult customResult = new DesignPanelHitTestResult((Visual)result.VisualHit);
145-
148+
146149
ViewService viewService = _context.Services.View;
147150
DependencyObject obj = result.VisualHit;
148151

@@ -210,6 +213,8 @@ public DesignPanel()
210213

211214
#region Properties
212215

216+
//Set custom HitTestFilterCallbak
217+
public HitTestFilterCallback CustomHitTestFilterBehavior { get; set; }
213218
/// <summary>
214219
/// Gets/Sets the design context.
215220
/// </summary>

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ExtensionMethods.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ namespace ICSharpCode.WpfDesign.Designer
3131
{
3232
public static class ExtensionMethods
3333
{
34+
35+
public static bool AnyIsInNamespace(this Type type, string namespacestr)
36+
{
37+
Type t = type;
38+
while (t!=null)
39+
{
40+
if (t.Namespace.Equals(namespacestr))
41+
return true;
42+
t = t.BaseType;
43+
}
44+
return false;
45+
}
46+
3447
public static double Coerce(this double value, double min, double max)
3548
{
3649
return Math.Max(Math.Min(value, max), min);

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/QuickOperationMenuExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
3333
/// </summary>
3434
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
3535
[ExtensionFor(typeof (FrameworkElement))]
36-
class QuickOperationMenuExtension : PrimarySelectionAdornerProvider
36+
public class QuickOperationMenuExtension : PrimarySelectionAdornerProvider
3737
{
3838
private QuickOperationMenu _menu;
3939
private KeyBinding _keyBinding;

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SizeDisplayExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
3333
/// Display Height/Width on the primary selection
3434
/// </summary>
3535
[ExtensionFor(typeof(UIElement))]
36-
class SizeDisplayExtension : PrimarySelectionAdornerProvider
36+
public class SizeDisplayExtension : PrimarySelectionAdornerProvider
3737
{
3838
HeightDisplay _heightDisplay;
3939
WidthDisplay _widthDisplay;

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ public Outline()
4040
}
4141

4242
public static readonly DependencyProperty RootProperty =
43-
DependencyProperty.Register("Root", typeof(OutlineNode), typeof(Outline));
43+
DependencyProperty.Register("Root", typeof(IOutlineNode), typeof(Outline));
4444

45-
public OutlineNode Root {
46-
get { return (OutlineNode)GetValue(RootProperty); }
45+
public IOutlineNode Root
46+
{
47+
get { return (IOutlineNode)GetValue(RootProperty); }
4748
set { SetValue(RootProperty, value); }
4849
}
4950

0 commit comments

Comments
 (0)