diff --git a/samples/XamlDesigner/XamlDesigner.csproj b/samples/XamlDesigner/XamlDesigner.csproj
index aaec0d7d01..bb9af8668d 100644
--- a/samples/XamlDesigner/XamlDesigner.csproj
+++ b/samples/XamlDesigner/XamlDesigner.csproj
@@ -58,6 +58,9 @@
3.5
+
+ 4.0
+
3.5
diff --git a/samples/XamlDesigner2/App.xaml b/samples/XamlDesigner2/App.xaml
deleted file mode 100644
index 12438427b8..0000000000
--- a/samples/XamlDesigner2/App.xaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/XamlDesigner2/App.xaml.cs b/samples/XamlDesigner2/App.xaml.cs
deleted file mode 100644
index e91af9e345..0000000000
--- a/samples/XamlDesigner2/App.xaml.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Windows;
-using SharpDevelop.Samples.XamlDesigner.Properties;
-using System.Windows.Threading;
-using System.Diagnostics;
-
-namespace SharpDevelop.Samples.XamlDesigner
-{
- public partial class App : Application
- {
- public static string[] Args;
-
- protected override void OnStartup(StartupEventArgs e)
- {
- Args = e.Args;
- DispatcherUnhandledException += App_DispatcherUnhandledException;
- System.Windows.Forms.Application.EnableVisualStyles();
- base.OnStartup(e);
- }
-
- void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
- {
- if (!Debugger.IsAttached && Shell.Instance.CurrentDocument != null) {
- Shell.Instance.CurrentDocument.Context.DesignView.Exception = e.Exception;
- e.Handled = true;
- }
- }
-
- protected override void OnExit(ExitEventArgs e)
- {
- Settings.Default.Save();
- base.OnExit(e);
- }
- }
-}
diff --git a/samples/XamlDesigner2/Converters.cs b/samples/XamlDesigner2/Converters.cs
deleted file mode 100644
index fc24c41a1d..0000000000
--- a/samples/XamlDesigner2/Converters.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Data;
-using System.Globalization;
-using System.Windows;
-using System.Collections;
-using AvalonDock;
-
-namespace SharpDevelop.Samples.XamlDesigner.Converters
-{
- public class EnumToIntConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return (int)value;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return value;
- }
- }
-
- public class CollapsedWhenFalse : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return (bool)value ? Visibility.Visible : Visibility.Collapsed;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-
- public class FalseWhenZero : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value == null || (int)value == 0) {
- return false;
- }
- return true;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-
- public class LevelConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return new Thickness(5 + 19 * (int)value, 0, 5, 0);
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/samples/XamlDesigner2/ExtensionMethods.cs b/samples/XamlDesigner2/ExtensionMethods.cs
deleted file mode 100644
index cd11839c95..0000000000
--- a/samples/XamlDesigner2/ExtensionMethods.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Documents;
-using System.Windows.Media;
-using System.IO;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.Collections;
-
-namespace SharpDevelop.Samples.XamlDesigner
-{
- static class ExtensionMethods
- {
- public static IEnumerable Paths(this IDataObject data)
- {
- string[] paths = (string[])data.GetData(DataFormats.FileDrop);
- if (paths != null) {
- foreach (var path in paths) {
- yield return path;
- }
- }
- }
-
- public static T GetObject(this IDataObject data)
- {
- return (T)data.GetData(typeof(T).FullName);
- }
-
- public static Stream ToStream(this string s)
- {
- return new MemoryStream(Encoding.UTF8.GetBytes(s));
- }
-
- public static void AddRange(this ObservableCollection col, IEnumerable items)
- {
- foreach (var item in items) {
- col.Add(item);
- }
- }
-
- public static void KeepSyncronizedWith(this IList target, ObservableCollection source, Func convert)
- {
- target.Clear();
- foreach (var item in source) {
- target.Add(convert(item));
- }
-
- source.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e) {
- switch (e.Action) {
- case NotifyCollectionChangedAction.Add:
- target.Add(convert((S)e.NewItems[0]));
- break;
-
- case NotifyCollectionChangedAction.Remove:
- target.RemoveAt(e.OldStartingIndex);
- break;
-
- case NotifyCollectionChangedAction.Move:
- target.RemoveAt(e.OldStartingIndex);
- target.Insert(e.NewStartingIndex, e.NewItems[0]);
- break;
-
- case NotifyCollectionChangedAction.Replace:
- target[e.NewStartingIndex] = convert((S)e.NewItems[0]);
- break;
-
- case NotifyCollectionChangedAction.Reset:
- target.Clear();
- break;
- }
- };
- }
-
- public static object GetDataContext(this RoutedEventArgs e)
- {
- var f = e.OriginalSource as FrameworkElement;
- if (f != null) return f.DataContext;
- return null;
- }
- }
-}
diff --git a/samples/XamlDesigner2/Images/Error.png b/samples/XamlDesigner2/Images/Error.png
deleted file mode 100644
index c37bd062e6..0000000000
Binary files a/samples/XamlDesigner2/Images/Error.png and /dev/null differ
diff --git a/samples/XamlDesigner2/Images/Reference.png b/samples/XamlDesigner2/Images/Reference.png
deleted file mode 100644
index da47049481..0000000000
Binary files a/samples/XamlDesigner2/Images/Reference.png and /dev/null differ
diff --git a/samples/XamlDesigner2/Images/Tag.png b/samples/XamlDesigner2/Images/Tag.png
deleted file mode 100644
index b7686f106b..0000000000
Binary files a/samples/XamlDesigner2/Images/Tag.png and /dev/null differ
diff --git a/samples/XamlDesigner2/MainWindow.xaml b/samples/XamlDesigner2/MainWindow.xaml
deleted file mode 100644
index 1872b10067..0000000000
--- a/samples/XamlDesigner2/MainWindow.xaml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/XamlDesigner2/MainWindow.xaml.cs b/samples/XamlDesigner2/MainWindow.xaml.cs
deleted file mode 100644
index 177fa59959..0000000000
--- a/samples/XamlDesigner2/MainWindow.xaml.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-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;
-using SharpDevelop.Samples.XamlDesigner.Properties;
-using System.ComponentModel;
-using Microsoft.Win32;
-using AvalonDock;
-using System.IO;
-using System.Collections.Specialized;
-using System.Globalization;
-using SharpDevelop.XamlDesigner;
-
-namespace SharpDevelop.Samples.XamlDesigner
-{
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- Instance = this;
- DataContext = Shell.Instance;
-
- InitializeComponent();
-
- AvalonDockWorkaround();
- LoadSettings();
- ProcessPaths(App.Args);
-
- Shell.Instance.Open("../../TestFiles/6.xaml");
- }
-
- public static MainWindow Instance;
-
- OpenFileDialog openFileDialog;
- SaveFileDialog saveFileDialog;
-
- void RecentFiles_Click(object sender, RoutedEventArgs e)
- {
- var path = (string)(e.OriginalSource as MenuItem).Header;
- Shell.Instance.Open(path);
- }
-
- protected override void OnClosing(CancelEventArgs e)
- {
- if (Shell.Instance.PrepareExit()) {
- SaveSettings();
- }
- else {
- e.Cancel = true;
- }
- base.OnClosing(e);
- }
-
- protected override void OnDragEnter(DragEventArgs e)
- {
- ProcessDrag(e);
- }
-
- protected override void OnDragOver(DragEventArgs e)
- {
- ProcessDrag(e);
- }
-
- protected override void OnDrop(DragEventArgs e)
- {
- ProcessPaths(e.Data.Paths());
- }
-
- void ProcessDrag(DragEventArgs e)
- {
- e.Effects = DragDropEffects.None;
- e.Handled = true;
-
- foreach (var path in e.Data.Paths()) {
- if (HasXamlExtension(path)) {
- e.Effects = DragDropEffects.Copy;
- break;
- }
- }
- }
-
- void ProcessPaths(IEnumerable paths)
- {
- foreach (var path in paths) {
- if (HasXamlExtension(path)) {
- Shell.Instance.Open(path);
- }
- }
- }
-
- public static bool HasXamlExtension(string filePath)
- {
- return System.IO.Path.GetExtension(filePath).Equals(".xaml", StringComparison.InvariantCultureIgnoreCase);
- }
-
- public string AskOpenFileName()
- {
- if (openFileDialog == null) {
- openFileDialog = new OpenFileDialog();
- openFileDialog.Filter = "Xaml Documents (*.xaml)|*.xaml";
- }
- if ((bool)openFileDialog.ShowDialog()) {
- return openFileDialog.FileName;
- }
- return null;
- }
-
- public string AskSaveFileName(string initName)
- {
- if (saveFileDialog == null) {
- saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Xaml Documents (*.xaml)|*.xaml";
- }
- saveFileDialog.FileName = initName;
- if ((bool)saveFileDialog.ShowDialog()) {
- return saveFileDialog.FileName;
- }
- return null;
- }
-
- void LoadSettings()
- {
- WindowState = Settings.Default.MainWindowState;
-
- Rect r = Settings.Default.MainWindowRect;
- if (r != new Rect()) {
- Left = r.Left;
- Top = r.Top;
- Width = r.Width;
- Height = r.Height;
- }
-
- if (!string.IsNullOrEmpty(Settings.Default.AvalonDockLayout)) {
- uxDockingManager.RestoreLayout(Settings.Default.AvalonDockLayout.ToStream());
- }
-
- if (!string.IsNullOrEmpty(Settings.Default.PaletteData)) {
- uxPalette.LoadData(Settings.Default.PaletteData);
- }
- else {
- uxPalette.ResetData();
- }
- }
-
- void SaveSettings()
- {
- Settings.Default.MainWindowState = WindowState;
- if (WindowState == WindowState.Normal) {
- Settings.Default.MainWindowRect = new Rect(Left, Top, Width, Height);
- }
-
- var writer = new StringWriter();
- uxDockingManager.SaveLayout(writer);
- Settings.Default.AvalonDockLayout = writer.ToString();
-
- Settings.Default.PaletteData = uxPalette.SaveData();
-
- Shell.Instance.SaveSettings();
- }
-
- #region AvalonDockWorkaround
-
- void AvalonDockWorkaround()
- {
- uxDocumentPane.Items.KeepSyncronizedWith(Shell.Instance.Documents, d => CreateContentFor(d));
- }
-
- DocumentContent CreateContentFor(ShellDocument doc)
- {
- var content = new DocumentContent() {
- DataContext = doc,
- Content = doc.View
- };
- content.SetBinding(DocumentContent.TitleProperty, "Title");
- return content;
- }
-
- #endregion
-
- #region DockableContentVisibility
-
- public static DockableContentVisibility GetDockableContentVisibility(DependencyObject obj)
- {
- return (DockableContentVisibility)obj.GetValue(DockableContentVisibilityProperty);
- }
-
- public static void SetDockableContentVisibility(DependencyObject obj, DockableContentVisibility value)
- {
- obj.SetValue(DockableContentVisibilityProperty, value);
- }
-
- public static readonly DependencyProperty DockableContentVisibilityProperty =
- DependencyProperty.RegisterAttached("DockableContentVisibility", typeof(DockableContentVisibility), typeof(MainWindow));
-
- public static bool GetAttachDockableContentVisibility(DependencyObject obj)
- {
- return (bool)obj.GetValue(AttachDockableContentVisibilityProperty);
- }
-
- public static void SetAttachDockableContentVisibility(DependencyObject obj, bool value)
- {
- obj.SetValue(AttachDockableContentVisibilityProperty, value);
- }
-
- public static readonly DependencyProperty AttachDockableContentVisibilityProperty =
- DependencyProperty.RegisterAttached("AttachDockableContentVisibility", typeof(bool), typeof(MainWindow),
- new PropertyMetadata(AttachDockableContentVisibilityChanged));
-
- static void AttachDockableContentVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var v = new DockableContentVisibility(d as DockableContent, MainWindow.Instance.uxDockingManager);
- SetDockableContentVisibility(d, v);
- }
-
- public class DockableContentVisibility : ViewModel
- {
- public DockableContentVisibility(DockableContent content, DockingManager manager)
- {
- this.content = content;
- this.manager = manager;
-
- var dpd = DependencyPropertyDescriptor.FromProperty(DockableContent.StatePropertyKey.DependencyProperty, typeof(DockableContent));
- dpd.AddValueChanged(content, (s, e) => { RaisePropertyChanged("IsVisible"); });
- }
-
- DockableContent content;
- DockingManager manager;
-
- public bool IsVisible
- {
- get
- {
- return content.State != DockableContentState.Hidden;
- }
- set
- {
- if (value) {
- manager.Show(content);
- }
- else {
- manager.Hide(content);
- }
- RaisePropertyChanged("IsVisible");
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/samples/XamlDesigner2/NewFileTemplate.xaml b/samples/XamlDesigner2/NewFileTemplate.xaml
deleted file mode 100644
index a2b830f012..0000000000
--- a/samples/XamlDesigner2/NewFileTemplate.xaml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/samples/XamlDesigner2/Properties/AssemblyInfo.cs b/samples/XamlDesigner2/Properties/AssemblyInfo.cs
deleted file mode 100644
index c0ea722fa8..0000000000
--- a/samples/XamlDesigner2/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-using System.Windows;
-
-[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
\ No newline at end of file
diff --git a/samples/XamlDesigner2/Properties/Settings.Designer.cs b/samples/XamlDesigner2/Properties/Settings.Designer.cs
deleted file mode 100644
index 9b2157575e..0000000000
--- a/samples/XamlDesigner2/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3053
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SharpDevelop.Samples.XamlDesigner.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0,0,0,0")]
- public global::System.Windows.Rect MainWindowRect {
- get {
- return ((global::System.Windows.Rect)(this["MainWindowRect"]));
- }
- set {
- this["MainWindowRect"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public global::System.Collections.Specialized.StringCollection RecentFiles {
- get {
- return ((global::System.Collections.Specialized.StringCollection)(this["RecentFiles"]));
- }
- set {
- this["RecentFiles"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute(@"
-
- %ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll
-")]
- public global::System.Collections.Specialized.StringCollection AssemblyList {
- get {
- return ((global::System.Collections.Specialized.StringCollection)(this["AssemblyList"]));
- }
- set {
- this["AssemblyList"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Maximized")]
- public global::System.Windows.WindowState MainWindowState {
- get {
- return ((global::System.Windows.WindowState)(this["MainWindowState"]));
- }
- set {
- this["MainWindowState"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string AvalonDockLayout {
- get {
- return ((string)(this["AvalonDockLayout"]));
- }
- set {
- this["AvalonDockLayout"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string PaletteData {
- get {
- return ((string)(this["PaletteData"]));
- }
- set {
- this["PaletteData"] = value;
- }
- }
- }
-}
diff --git a/samples/XamlDesigner2/Properties/Settings.settings b/samples/XamlDesigner2/Properties/Settings.settings
deleted file mode 100644
index 7930f5f0d3..0000000000
--- a/samples/XamlDesigner2/Properties/Settings.settings
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
- 0,0,0,0
-
-
-
-
-
- <?xml version="1.0" encoding="utf-16"?>
-<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <string>%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll</string>
-</ArrayOfString>
-
-
- Maximized
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/XamlDesigner2/Properties/app.manifest b/samples/XamlDesigner2/Properties/app.manifest
deleted file mode 100644
index e82a10f183..0000000000
--- a/samples/XamlDesigner2/Properties/app.manifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/AdornerManager.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/AdornerManager.cs
deleted file mode 100644
index 49f88d71d3..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/AdornerManager.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Documents;
-using SharpDevelop.XamlDesigner.Controls;
-using SharpDevelop.XamlDesigner.Placement;
-using System.Windows.Controls.Primitives;
-using System.Windows.Controls;
-using System.Windows.Media;
-using SharpDevelop.XamlDesigner.Dom;
-
-namespace SharpDevelop.XamlDesigner
-{
- public class AdornerManager
- {
- public AdornerManager(DesignContext context)
- {
- this.context = context;
- context.Selection.Changed += new DesignSelectionChangedHandler(Selection_Changed);
- }
-
- DesignContext context;
- GeneralAdorner insertAdorner;
-
- AdornerLayer AdornerLayer
- {
- get { return context.DesignView.AdornerLayer; }
- }
-
- void Selection_Changed(object sender, DesignSelectionChangedEventArgs e)
- {
- foreach (var item in e.OldItems) {
- if (item.View != null) {
- OnUnselect(item);
- }
- }
- foreach (var item in e.NewItems) {
- if (item.View != null) {
- OnSelect(item);
- }
- }
- }
-
- void AddGeneralAdorner(DesignItem item, FrameworkElement adorner)
- {
- var generalAdorner = new GeneralAdorner(item.View);
- generalAdorner.Child = adorner;
- AdornerLayer.Add(generalAdorner);
- }
-
- void ClearAdorners(DesignItem item)
- {
- if (item.View != null) {
- var adorners = AdornerLayer.GetAdorners(item.View);
- if (adorners != null) {
- foreach (var adorner in adorners) {
- AdornerLayer.Remove(adorner);
- }
- }
- }
- }
-
- public void OnSelect(DesignItem item)
- {
- AddGeneralAdorner(item, new ResizeAdorner());
- }
-
- public void OnUnselect(DesignItem item)
- {
- ClearAdorners(item);
- }
-
- public void OnBeginMove(IEnumerable items)
- {
- foreach (var item in context.Selection) {
- ClearAdorners(item);
- }
- foreach (var item in items) {
- AddGeneralAdorner(item, new MoveAdorner());
- }
- }
-
- public void OnEndMove(IEnumerable items)
- {
- foreach (var item in items) {
- ClearAdorners(item);
- }
- foreach (var item in context.Selection) {
- OnSelect(item);
- }
- }
-
- public void ShowInsertAdorner(FrameworkElement target, Rect area, Dock side)
- {
- if (insertAdorner == null) {
- insertAdorner = new GeneralAdorner(target);
- AdornerLayer.Add(insertAdorner);
- }
-
- Point location;
- double length;
- Orientation orientation;
-
- switch (side) {
- case Dock.Left:
- location = area.TopLeft;
- length = area.Height;
- orientation = Orientation.Vertical;
- break;
- case Dock.Right:
- location = area.TopRight;
- length = area.Height;
- orientation = Orientation.Vertical;
- break;
- case Dock.Top:
- location = area.TopLeft;
- length = area.Width;
- orientation = Orientation.Horizontal;
- break;
- default:
- location = area.BottomLeft;
- length = area.Width;
- orientation = Orientation.Horizontal;
- break;
- }
-
- var insertLine = new InsertLine();
- insertAdorner.Child = insertLine;
- insertAdorner.ChildSize = new Size(length, double.NaN);
- insertAdorner.ChildLocation = location;
-
- if (orientation == Orientation.Vertical) {
- insertLine.LayoutTransform = new RotateTransform(90);
- }
- }
-
- public void HideInsertAdorner()
- {
- if (insertAdorner != null) {
- AdornerLayer.Remove(insertAdorner);
- insertAdorner = null;
- }
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ContainerAdorner.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ContainerAdorner.cs
deleted file mode 100644
index 159a05d995..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ContainerAdorner.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace SharpDevelop.XamlDesigner
-{
- class ContainerAdorner : Control
- {
- static ContainerAdorner()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ContainerAdorner),
- new FrameworkPropertyMetadata(typeof(ContainerAdorner)));
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/GrabAdorner.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/GrabAdorner.cs
deleted file mode 100644
index fe8a0709fc..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/GrabAdorner.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace SharpDevelop.XamlDesigner
-{
- class GrabAdorner
- {
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/InsertLine.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/InsertLine.cs
deleted file mode 100644
index d18c24ed69..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/InsertLine.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace SharpDevelop.XamlDesigner
-{
- class InsertLine : Control
- {
- static InsertLine()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(InsertLine),
- new FrameworkPropertyMetadata(typeof(InsertLine)));
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/MoveAdorner.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/MoveAdorner.cs
deleted file mode 100644
index 3db75a87bb..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/MoveAdorner.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace SharpDevelop.XamlDesigner
-{
- class MoveAdorner : Control
- {
- static MoveAdorner()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(MoveAdorner),
- new FrameworkPropertyMetadata(typeof(MoveAdorner)));
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/PanelAdorner.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/PanelAdorner.cs
deleted file mode 100644
index c241e986c0..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/PanelAdorner.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace SharpDevelop.XamlDesigner
-{
- class PanelAdorner : Control
- {
- static PanelAdorner()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(PanelAdorner),
- new FrameworkPropertyMetadata(typeof(PanelAdorner)));
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ResizeAdorner.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ResizeAdorner.cs
deleted file mode 100644
index 3da6f2abd8..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Adorners/ResizeAdorner.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-using System.Windows;
-using System.Windows.Input;
-
-namespace SharpDevelop.XamlDesigner
-{
- class ResizeAdorner : Control
- {
- static ResizeAdorner()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ResizeAdorner),
- new FrameworkPropertyMetadata(typeof(ResizeAdorner)));
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/App.xaml b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/App.xaml
deleted file mode 100644
index 6cf985f8a8..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/App.xaml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
- #516675
- #99BFDB
-
-
-
-
\ No newline at end of file
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandBase.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandBase.cs
deleted file mode 100644
index 341d8ebfb1..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandBase.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Input;
-
-namespace SharpDevelop.XamlDesigner.Commanding
-{
- public abstract class CommandBase
- {
- public string CommandName { get; internal set; }
-
- public virtual bool CanExecute(object parameter)
- {
- return true;
- }
-
- public virtual void Execute(object parameter)
- {
- }
- }
-}
diff --git a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandHelper.cs b/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandHelper.cs
deleted file mode 100644
index 45c1c640cf..0000000000
--- a/samples/XamlDesigner2/SharpDevelop.XamlDesigner/Commanding/CommandHelper.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Input;
-using System.Windows.Controls;
-using System.Reflection;
-using System.Windows.Media;
-
-namespace SharpDevelop.XamlDesigner.Commanding
-{
- public static class CommandHelper
- {
- static CommandHelper()
- {
- CommandManager.RequerySuggested += RequerySuggestedDelegate;
- }
-
- static EventHandler RequerySuggestedDelegate = RequerySuggested;
- static DefaultContainerStyles DefaultContainerStyles = new DefaultContainerStyles();
- static List TrackingElements = new List();
-
- static MethodInfo CommandConverter_GetKnownCommand = typeof(CommandConverter)
- .GetMethod("GetKnownCommand", BindingFlags.NonPublic | BindingFlags.Static);
-
- public static string GetCommand(DependencyObject obj)
- {
- return (string)obj.GetValue(CommandProperty);
- }
-
- public static void SetCommand(DependencyObject obj, object value)
- {
- obj.SetValue(CommandProperty, value);
- }
-
- public static readonly DependencyProperty CommandProperty =
- DependencyProperty.RegisterAttached("Command", typeof(string), typeof(CommandHelper),
- new FrameworkPropertyMetadata(CommandPropertyChanged));
-
- //public static object GetCommandTarget(DependencyObject obj)
- //{
- // return (object)obj.GetValue(CommandTargetProperty);
- //}
-
- //public static void SetCommandTarget(DependencyObject obj, object value)
- //{
- // obj.SetValue(CommandTargetProperty, value);
- //}
-
- //public static readonly DependencyProperty CommandTargetProperty =
- // DependencyProperty.RegisterAttached("CommandTarget", typeof(object), typeof(CommandHelper),
- // new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-
- public static CommandView GetCommandView(DependencyObject obj)
- {
- return (CommandView)obj.GetValue(CommandViewProperty);
- }
-
- public static void SetCommandView(DependencyObject obj, CommandView value)
- {
- obj.SetValue(CommandViewProperty, value);
- }
-
- public static readonly DependencyProperty CommandViewProperty =
- DependencyProperty.RegisterAttached("CommandView", typeof(CommandView), typeof(CommandHelper));
-
- static void CommandPropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
- {
- var commandName = (string)e.NewValue;
- var element = target as FrameworkElement;
- var view = element.TryFindResource(commandName) as CommandView;
-
- if (view == null) {
- view = new CommandView();
- view.Text = commandName;
- }
-
- view.CommandName = commandName;
-
- SetCommandView(element, view);
-
- TrackingElements.Add(new WeakReference(element));
-
- var routedCommand = CommandConverter_GetKnownCommand.Invoke(null, new[] { commandName, null }) as RoutedCommand;
- if (routedCommand != null) {
- view.InitializeFromRoutedCommand(routedCommand);
- }
-
- var key = new ContainerStyleKey(element.GetType());
- var style = element.TryFindResource(key) as Style;
- if (style == null) {
- style = DefaultContainerStyles[key] as Style;
- }
-
- style.BasedOn = element.FindResource(element.GetType()) as Style;
- element.Style = style;
-
- if (view.Shortcut != null) {
- Application.Current.MainWindow.InputBindings.Add(
- new InputBinding(new ShortcutCommand() { Sender = element }, view.Shortcut));
- }
- }
-
- public static void RequerySuggested(object sender, EventArgs e)
- {
- foreach (var weak in TrackingElements) {
- if (weak.IsAlive) {
- var element = weak.Target as FrameworkElement;
- if (element.IsLoaded) {
- var handler = FindCommandHandler(element);
- var view = GetCommandView(element);
- if (handler != null) {
- view.IsEnabled = handler.CanExecute(null);
- }
- else {
- view.IsEnabled = false;
- }
- }
- }
- }
- }
-
- public static void TryExecuteCommand(object sender)
- {
- var handler = FindCommandHandler(sender);
- if (handler != null) {
- handler.Execute(null);
- }
- }
-
- public static CommandBase FindCommandHandler(object sender)
- {
- CommandBase handler = null;
- var d = sender as DependencyObject;
- if (d != null) {
- var commandView = GetCommandView(d);
- if (commandView != null) {
- //var target = GetCommandTarget(d);
- //if (target != null) {
- // handler = FindCommandHandler(target, commandView.CommandName);
- //}
- if (handler == null) {
- handler = FindCommandHandler(sender, commandView.CommandName);
- }
- }
- }
- return handler;
- }
-
- static CommandBase FindCommandHandler(object start, string commandName)
- {
- foreach (var step in GetCommandChain(start)) {
- var hasCommands = step as IHasCommands;
- if (hasCommands != null) {
- foreach (var commandHandler in hasCommands.Commands) {
- if (commandHandler.CommandName == commandName) {
- return commandHandler;
- }
- }
- }
- }
- return null;
- }
-
- static IEnumerable