From 517a3929fb0a4b7a05d56ae123630e686c092aff Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Fri, 31 Oct 2014 23:55:53 +0100 Subject: [PATCH 01/21] XAML Designer Demo Project -> Fix for Assembly search --- samples/XamlDesigner/App.xaml.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/samples/XamlDesigner/App.xaml.cs b/samples/XamlDesigner/App.xaml.cs index 6a9be5c98c..5d9484dadf 100644 --- a/samples/XamlDesigner/App.xaml.cs +++ b/samples/XamlDesigner/App.xaml.cs @@ -31,9 +31,16 @@ namespace ICSharpCode.XamlDesigner private static bool internalLoad = false; private static string lastRequesting = null; - + Assembly AppDomain_CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { + var assList = AppDomain.CurrentDomain.GetAssemblies(); + var loaded = assList.FirstOrDefault(x => x.FullName == args.Name); + if (loaded != null) + { + return loaded; + } + if (internalLoad) return null; @@ -48,7 +55,7 @@ namespace ICSharpCode.XamlDesigner ass = Assembly.Load(args.Name); } catch (Exception) { } - + if (ass == null && args.RequestingAssembly != null) { lastRequesting = args.RequestingAssembly.Location; var dir = Path.GetDirectoryName(args.RequestingAssembly.Location); @@ -68,7 +75,7 @@ namespace ICSharpCode.XamlDesigner } internalLoad = false; - + return ass; } From 836f506428368e9609586fdf75d87feaa7cc899b Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Fri, 31 Oct 2014 23:56:41 +0100 Subject: [PATCH 02/21] Fix a Null ref. Exception in Thumbnail View (when rootItem could not be parsed) --- .../WpfDesign.Designer/Project/ThumbnailView/ThumbnailView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ThumbnailView/ThumbnailView.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ThumbnailView/ThumbnailView.cs index fc837b3a43..2913fa6bdc 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ThumbnailView/ThumbnailView.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ThumbnailView/ThumbnailView.cs @@ -133,7 +133,7 @@ namespace ICSharpCode.WpfDesign.Designer.ThumbnailView xOffset = 0; yOffset = 0; - if (this.DesignSurface.DesignContext != null) + if (this.DesignSurface.DesignContext != null && this.DesignSurface.DesignContext.RootItem != null) { var designedElement = this.DesignSurface.DesignContext.RootItem.Component as FrameworkElement; From edc62f082f0397c074ee3cfea619d449cf189125 Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Fri, 31 Oct 2014 23:58:13 +0100 Subject: [PATCH 03/21] ^XAML Designer example Project -> Show only Controls with public parameterless Constructor --- samples/XamlDesigner/Toolbox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/XamlDesigner/Toolbox.cs b/samples/XamlDesigner/Toolbox.cs index d4880827a7..b4b400e8c6 100644 --- a/samples/XamlDesigner/Toolbox.cs +++ b/samples/XamlDesigner/Toolbox.cs @@ -78,7 +78,7 @@ namespace ICSharpCode.XamlDesigner static bool IsControl(Type t) { - return !t.IsAbstract && !t.IsGenericTypeDefinition && t.IsSubclassOf(typeof(FrameworkElement)); + return !t.IsAbstract && !t.IsGenericTypeDefinition && t.IsSubclassOf(typeof(UIElement)) && t.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null) != null; } } From 9b283d21cfded09e5f82005119b90286f6418535 Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Sat, 1 Nov 2014 00:01:45 +0100 Subject: [PATCH 04/21] XamlDesignItem -> Fix Event removal --- .../WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs index 008a5249d3..736a8ef126 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs @@ -134,7 +134,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml /// public override event EventHandler ParentChanged { add { _xamlObject.ParentPropertyChanged += value; } - remove { _xamlObject.ParentPropertyChanged += value; } + remove { _xamlObject.ParentPropertyChanged -= value; } } public override UIElement View { From f72e6b88064cd52cb48bfa3541d53afecea67377 Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Sat, 1 Nov 2014 00:23:44 +0100 Subject: [PATCH 05/21] New Unit Tests. "ListBox2" does not work at the moment! --- .../Tests/XamlDom/SamplesTests.cs | 136 +++++++++++------- 1 file changed, 86 insertions(+), 50 deletions(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs index 7d490b2150..37902a37d2 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs @@ -127,7 +127,7 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom } [Test] - public void Resources() + public void Resources1() { TestLoading(@""); } - [Test] - public void Resources2() - { - TestLoading(@" "); - } + } - [Test] + [Test] public void Resources3() { TestLoading(@""); } - [Test] - public void Resources4() - { - TestLoading(@" @@ -177,8 +177,25 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom "); - } - + } + + [Test] + public void Resources5() + { + TestLoading(@" + + + + + + + + "); + } + + [Test] public void Animation1() { @@ -234,7 +251,7 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom [Test] public void Animation3() { - TestLoading(@" @@ -258,10 +275,10 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom "); } - [Test] - public void ContentControl1() - { - TestLoading(@" @@ -270,12 +287,12 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom "); - } + } - [Test] - public void ContentControl2() - { - TestLoading(@" @@ -286,24 +303,24 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom "); - } + } - [Test] - public void Children1() - { - TestLoading(@"