diff --git a/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj b/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj
index 32ee8a6..139b013 100644
--- a/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj
+++ b/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj
@@ -60,12 +60,19 @@
MSBuild:Compile
Designer
+
+ ControlContainer.xaml
+
TestPage2.xaml
TestPage.xaml
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/BrightSharp.Ui.Tests/ControlContainer.xaml b/BrightSharp.Ui.Tests/ControlContainer.xaml
new file mode 100644
index 0000000..296e303
--- /dev/null
+++ b/BrightSharp.Ui.Tests/ControlContainer.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/BrightSharp.Ui.Tests/ControlContainer.xaml.cs b/BrightSharp.Ui.Tests/ControlContainer.xaml.cs
new file mode 100644
index 0000000..a690158
--- /dev/null
+++ b/BrightSharp.Ui.Tests/ControlContainer.xaml.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BrightSharp.Ui.Tests
+{
+ ///
+ /// Interaction logic for ControlContainer.xaml
+ ///
+ public partial class ControlContainer : Window
+ {
+ public ControlContainer() {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BrightSharp.Ui.Tests/MainWindow.xaml.cs b/BrightSharp.Ui.Tests/MainWindow.xaml.cs
index f3b372f..8055a41 100644
--- a/BrightSharp.Ui.Tests/MainWindow.xaml.cs
+++ b/BrightSharp.Ui.Tests/MainWindow.xaml.cs
@@ -1,5 +1,4 @@
-using BrightSharp.Converters;
-using Diagrams;
+using BrightSharp.Diagrams;
using System;
using System.Text.RegularExpressions;
using System.Windows;
diff --git a/BrightSharp/Behaviors/FiterGridTextBoxBehavior.cs b/BrightSharp/Behaviors/FiterGridTextBoxBehavior.cs
index 108e337..688db6c 100644
--- a/BrightSharp/Behaviors/FiterGridTextBoxBehavior.cs
+++ b/BrightSharp/Behaviors/FiterGridTextBoxBehavior.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections;
-using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
diff --git a/BrightSharp/Diagrams/Adorners/ResizeRotateAdorner.cs b/BrightSharp/Diagrams/Adorners/ResizeRotateAdorner.cs
index eb83507..343b2d6 100644
--- a/BrightSharp/Diagrams/Adorners/ResizeRotateAdorner.cs
+++ b/BrightSharp/Diagrams/Adorners/ResizeRotateAdorner.cs
@@ -2,10 +2,9 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
-using System.Windows.Input;
using System.Windows.Media;
-namespace Diagrams
+namespace BrightSharp.Diagrams
{
[ToolboxItem(false)]
public class ResizeRotateAdorner : Adorner
@@ -17,7 +16,7 @@ namespace Diagrams
{
get
{
- return this.visuals.Count;
+ return visuals.Count;
}
}
@@ -25,24 +24,24 @@ namespace Diagrams
: base(designerItem)
{
SnapsToDevicePixels = true;
- this.chrome = new ResizeRotateChrome();
- this.chrome.DataContext = designerItem;
- this.visuals = new VisualCollection(this);
- this.visuals.Add(this.chrome);
- this.Focusable = true;
+ chrome = new ResizeRotateChrome();
+ chrome.DataContext = designerItem;
+ visuals = new VisualCollection(this);
+ visuals.Add(chrome);
+ Focusable = true;
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
- this.chrome.Arrange(new Rect(arrangeBounds));
+ chrome.Arrange(new Rect(arrangeBounds));
return arrangeBounds;
}
protected override Visual GetVisualChild(int index)
{
- return this.visuals[index];
+ return visuals[index];
}
}
diff --git a/BrightSharp/Diagrams/Adorners/ResizeRotateChrome.cs b/BrightSharp/Diagrams/Adorners/ResizeRotateChrome.cs
index 99d814a..7f60b09 100644
--- a/BrightSharp/Diagrams/Adorners/ResizeRotateChrome.cs
+++ b/BrightSharp/Diagrams/Adorners/ResizeRotateChrome.cs
@@ -2,7 +2,7 @@
using System.Windows;
using System.Windows.Controls;
-namespace Diagrams
+namespace BrightSharp.Diagrams
{
[ToolboxItem(false)]
public class ResizeRotateChrome : Control
diff --git a/BrightSharp/Diagrams/Adorners/SizeAdorner.cs b/BrightSharp/Diagrams/Adorners/SizeAdorner.cs
index d91ce2f..0aa5b93 100644
--- a/BrightSharp/Diagrams/Adorners/SizeAdorner.cs
+++ b/BrightSharp/Diagrams/Adorners/SizeAdorner.cs
@@ -4,7 +4,7 @@ using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
-namespace Diagrams
+namespace BrightSharp.Diagrams
{
[ToolboxItem(false)]
public class SizeAdorner : Adorner
@@ -17,29 +17,29 @@ namespace Diagrams
{
get
{
- return this.visuals.Count;
+ return visuals.Count;
}
}
public SizeAdorner(ContentControl designerItem)
: base(designerItem)
{
- this.SnapsToDevicePixels = true;
+ SnapsToDevicePixels = true;
this.designerItem = designerItem;
- this.chrome = new SizeChrome();
- this.chrome.DataContext = designerItem;
- this.visuals = new VisualCollection(this);
- this.visuals.Add(this.chrome);
+ chrome = new SizeChrome();
+ chrome.DataContext = designerItem;
+ visuals = new VisualCollection(this);
+ visuals.Add(chrome);
}
protected override Visual GetVisualChild(int index)
{
- return this.visuals[index];
+ return visuals[index];
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
- this.chrome.Arrange(new Rect(new Point(0.0, 0.0), arrangeBounds));
+ chrome.Arrange(new Rect(new Point(0.0, 0.0), arrangeBounds));
return arrangeBounds;
}
}
diff --git a/BrightSharp/Diagrams/Adorners/SizeChrome.cs b/BrightSharp/Diagrams/Adorners/SizeChrome.cs
index 22f068c..1160a92 100644
--- a/BrightSharp/Diagrams/Adorners/SizeChrome.cs
+++ b/BrightSharp/Diagrams/Adorners/SizeChrome.cs
@@ -5,7 +5,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
-namespace Diagrams
+namespace BrightSharp.Diagrams
{
[ToolboxItem(false)]
@@ -13,7 +13,7 @@ namespace Diagrams
{
static SizeChrome()
{
- FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(SizeChrome), new FrameworkPropertyMetadata(typeof(SizeChrome)));
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(SizeChrome), new FrameworkPropertyMetadata(typeof(SizeChrome)));
}
}
diff --git a/BrightSharp/Diagrams/DesignerItemDecorator.cs b/BrightSharp/Diagrams/DesignerItemDecorator.cs
index 3febc28..918d9b4 100644
--- a/BrightSharp/Diagrams/DesignerItemDecorator.cs
+++ b/BrightSharp/Diagrams/DesignerItemDecorator.cs
@@ -1,16 +1,12 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows;
using System.Windows.Media;
-using System.Windows.Input;
using System.Windows.Media.Animation;
using System.ComponentModel;
-namespace Diagrams
+namespace BrightSharp.Diagrams
{
[ToolboxItem(false)]
public class DesignerItemDecorator : Control
@@ -29,63 +25,63 @@ namespace Diagrams
public DesignerItemDecorator()
{
- Unloaded += new RoutedEventHandler(this.DesignerItemDecorator_Unloaded);
+ Unloaded += new RoutedEventHandler(DesignerItemDecorator_Unloaded);
}
private void HideAdorner()
{
- if (this.adorner != null)
+ if (adorner != null)
{
- this.adorner.Visibility = Visibility.Hidden;
+ adorner.Visibility = Visibility.Hidden;
}
}
private void ShowAdorner()
{
- if (this.adorner == null)
+ if (adorner == null)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
if (adornerLayer != null)
{
- ContentControl designerItem = this.DataContext as ContentControl;
+ ContentControl designerItem = DataContext as ContentControl;
Canvas canvas = VisualTreeHelper.GetParent(designerItem) as Canvas;
- this.adorner = new ResizeRotateAdorner(designerItem);
- adornerLayer.Add(this.adorner);
+ adorner = new ResizeRotateAdorner(designerItem);
+ adornerLayer.Add(adorner);
- if (this.ShowDecorator)
+ if (ShowDecorator)
{
- this.adorner.Visibility = Visibility.Visible;
+ adorner.Visibility = Visibility.Visible;
var anim = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(.2));
- this.adorner.BeginAnimation(OpacityProperty, anim);
+ adorner.BeginAnimation(OpacityProperty, anim);
}
else
{
- this.adorner.Visibility = Visibility.Hidden;
+ adorner.Visibility = Visibility.Hidden;
}
}
}
else
{
- this.adorner.Visibility = Visibility.Visible;
+ adorner.Visibility = Visibility.Visible;
var anim = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(.2));
- this.adorner.BeginAnimation(OpacityProperty, anim);
+ adorner.BeginAnimation(OpacityProperty, anim);
}
}
private void DesignerItemDecorator_Unloaded(object sender, RoutedEventArgs e)
{
- if (this.adorner != null)
+ if (adorner != null)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
if (adornerLayer != null)
{
- adornerLayer.Remove(this.adorner);
+ adornerLayer.Remove(adorner);
}
- this.adorner = null;
+ adorner = null;
}
}
diff --git a/BrightSharp/Diagrams/Resources/DesignerItem.xaml b/BrightSharp/Diagrams/Resources/DesignerItem.xaml
index 178496e..4028bcd 100644
--- a/BrightSharp/Diagrams/Resources/DesignerItem.xaml
+++ b/BrightSharp/Diagrams/Resources/DesignerItem.xaml
@@ -1,6 +1,6 @@
+ xmlns:s="clr-namespace:BrightSharp.Diagrams">
diff --git a/BrightSharp/Diagrams/Resources/ResizeRotateChrome.xaml b/BrightSharp/Diagrams/Resources/ResizeRotateChrome.xaml
index d034582..ae89737 100644
--- a/BrightSharp/Diagrams/Resources/ResizeRotateChrome.xaml
+++ b/BrightSharp/Diagrams/Resources/ResizeRotateChrome.xaml
@@ -1,6 +1,6 @@
+ xmlns:s="clr-namespace:BrightSharp.Diagrams">