diff --git a/HandyControl.sln b/HandyControl.sln
index a23bfefb..d8dca9bf 100644
--- a/HandyControl.sln
+++ b/HandyControl.sln
@@ -12,9 +12,11 @@ Global
Debug|Any CPU = Debug|Any CPU
Debug-Net40|Any CPU = Debug-Net40|Any CPU
Debug-Net45|Any CPU = Debug-Net45|Any CPU
+ Debug-Net47|Any CPU = Debug-Net47|Any CPU
Release|Any CPU = Release|Any CPU
Release-Net40|Any CPU = Release-Net40|Any CPU
Release-Net45|Any CPU = Release-Net45|Any CPU
+ Release-Net47|Any CPU = Release-Net47|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -23,24 +25,32 @@ Global
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net40|Any CPU.Build.0 = Debug-Net40|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
+ {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
+ {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release|Any CPU.Build.0 = Release|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net40|Any CPU.ActiveCfg = Release-Net40|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net40|Any CPU.Build.0 = Release-Net40|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
+ {DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
+ {DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net40|Any CPU.Build.0 = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug|Any CPU
+ {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug|Any CPU
+ {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release|Any CPU.Build.0 = Release|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net40|Any CPU.Build.0 = Release|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release|Any CPU
+ {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
+ {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/HandyControl/Controls/Other/GifImage.cs b/HandyControl/Controls/Image/GifImage.cs
similarity index 100%
rename from HandyControl/Controls/Other/GifImage.cs
rename to HandyControl/Controls/Image/GifImage.cs
diff --git a/HandyControl/Controls/Other/ImageViewer.cs b/HandyControl/Controls/Image/ImageViewer.cs
similarity index 100%
rename from HandyControl/Controls/Other/ImageViewer.cs
rename to HandyControl/Controls/Image/ImageViewer.cs
diff --git a/HandyControl/Controls/Other/RadioGroup.cs b/HandyControl/Controls/Other/RadioGroup.cs
index 86f957f7..97b9bc38 100644
--- a/HandyControl/Controls/Other/RadioGroup.cs
+++ b/HandyControl/Controls/Other/RadioGroup.cs
@@ -10,15 +10,6 @@ namespace HandyControl.Controls
protected override bool IsItemItsOwnContainerOverride(object item) => item is RadioButton;
- //public static readonly DependencyProperty GroupNameProperty = DependencyProperty.Register(
- // "GroupName", typeof(string), typeof(RadioGroup), new PropertyMetadata(default(string)));
-
- //public string GroupName
- //{
- // get => (string) GetValue(GroupNameProperty);
- // set => SetValue(GroupNameProperty, value);
- //}
-
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RadioGroup), new PropertyMetadata(default(Orientation)));
diff --git a/HandyControl/Controls/Other/CirclePanel.cs b/HandyControl/Controls/Panel/CirclePanel.cs
similarity index 100%
rename from HandyControl/Controls/Other/CirclePanel.cs
rename to HandyControl/Controls/Panel/CirclePanel.cs
diff --git a/HandyControl/Controls/Rate/Rate.cs b/HandyControl/Controls/Rate/Rate.cs
index d41d3256..d35524f0 100644
--- a/HandyControl/Controls/Rate/Rate.cs
+++ b/HandyControl/Controls/Rate/Rate.cs
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
Loaded += (s, e) =>
{
- if (DesignerHelper.IsInDesignMode()) return;
+ if (DesignerHelper.IsInDesignMode) return;
if (_isLoaded) return;
_isLoaded = true;
if (Value <= 0)
diff --git a/HandyControl/Controls/Text/OutlineText.cs b/HandyControl/Controls/Text/OutlineText.cs
index 9cd6c36f..be9022c9 100644
--- a/HandyControl/Controls/Text/OutlineText.cs
+++ b/HandyControl/Controls/Text/OutlineText.cs
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
return;
}
-#if net45 || net40
+#if netle45
_formattedText = new FormattedText(
Text,
CultureInfo.CurrentUICulture,
diff --git a/HandyControl/Controls/Window/Window.cs b/HandyControl/Controls/Window/Window.cs
index a4dc30a4..daa24f1a 100644
--- a/HandyControl/Controls/Window/Window.cs
+++ b/HandyControl/Controls/Window/Window.cs
@@ -6,7 +6,7 @@ using System.Windows.Input;
using System.Windows.Media;
using HandyControl.Data;
using HandyControl.Tools;
-#if net40
+#if netle40
using Microsoft.Windows.Shell;
#else
using System.Windows.Shell;
diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj
index 5a45f7e2..4b9efcc6 100644
--- a/HandyControl/HandyControl.csproj
+++ b/HandyControl/HandyControl.csproj
@@ -26,12 +26,23 @@
v4.6.2
netgt40
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ v4.7
+ netgt40
+
true
full
false
bin\Debug\
- DEBUG;TRACE;net45
+ DEBUG;TRACE;netle45
prompt
4
v4.5
@@ -42,7 +53,7 @@
full
false
bin\Debug\
- DEBUG;TRACE;net40
+ DEBUG;TRACE;netle45;netle40
prompt
4
v4.0
@@ -59,11 +70,22 @@
v4.6.2
netgt40
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ bin\Release\HandyControl.xml
+ v4.7
+ netgt40
+
pdbonly
true
bin\Release\
- TRACE;net45
+ TRACE;netle45
prompt
4
bin\Release\HandyControl.xml
@@ -74,7 +96,7 @@
pdbonly
true
bin\Release\
- TRACE;net40
+ TRACE;netle45;netle40
prompt
4
bin\Release\HandyControl.xml
@@ -108,14 +130,14 @@
-
+
-
+
@@ -123,7 +145,7 @@
-
+
@@ -721,9 +743,6 @@
-
-
-
diff --git a/HandyControl/Tools/Helper/DesignerHelper.cs b/HandyControl/Tools/Helper/DesignerHelper.cs
index 1f4d3416..7a92c9a0 100644
--- a/HandyControl/Tools/Helper/DesignerHelper.cs
+++ b/HandyControl/Tools/Helper/DesignerHelper.cs
@@ -1,60 +1,21 @@
-using System;
-using System.Linq;
-using System.Reflection;
+using System.ComponentModel;
+using System.Windows;
namespace HandyControl.Tools
{
public class DesignerHelper
{
- public static bool IsInDesignMode()
+ private static bool? _isInDesignMode;
+
+ public static bool IsInDesignMode
{
- try
+ get
{
- var type1 = Type.GetType(
- "System.ComponentModel.DesignerProperties, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
- if (type1 == null)
- return false;
- var obj1 = type1.GetTypeInfo().GetDeclaredField("IsInDesignModeProperty").GetValue(null);
- var type2 = Type.GetType(
- "System.ComponentModel.DependencyPropertyDescriptor, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
- var type3 = Type.GetType(
- "System.Windows.FrameworkElement, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
- if (type2 == null || type3 == null)
- return false;
- var list = type2.GetTypeInfo().GetDeclaredMethods("FromProperty").ToList();
- if (list.Count == 0)
- return false;
- var methodInfo = list.FirstOrDefault(mi =>
+ if (!_isInDesignMode.HasValue)
{
- if (mi.IsPublic && mi.IsStatic)
- return mi.GetParameters().Length == 2;
- return false;
- });
- if (methodInfo == null)
- return false;
- var obj2 = methodInfo.Invoke(null, new[]
- {
- obj1,
- type3
- });
- if (obj2 == null)
- return false;
- var declaredProperty1 = type2.GetTypeInfo().GetDeclaredProperty("Metadata");
- if (declaredProperty1 == null)
- return false;
- var obj3 = declaredProperty1.GetValue(obj2, null);
- var type4 = Type.GetType(
- "System.Windows.PropertyMetadata, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
- if (obj3 == null || type4 == null)
- return false;
- var declaredProperty2 = type4.GetTypeInfo().GetDeclaredProperty("DefaultValue");
- if (declaredProperty2 == null)
- return false;
- return (bool) declaredProperty2.GetValue(obj3, null);
- }
- catch
- {
- return false;
+ _isInDesignMode = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
+ }
+ return _isInDesignMode.Value;
}
}
}
diff --git a/HandyControlDemo/HandyControlDemo.csproj b/HandyControlDemo/HandyControlDemo.csproj
index 7b854b59..28172c88 100644
--- a/HandyControlDemo/HandyControlDemo.csproj
+++ b/HandyControlDemo/HandyControlDemo.csproj
@@ -37,6 +37,16 @@
4
v4.6.2
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ v4.7
+
Resources\Img\icon.ico
@@ -297,6 +307,9 @@
+
+ AboutWindow.xaml
+
BlurWindow.xaml
@@ -614,6 +627,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -718,6 +735,7 @@
+
diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
index 80dd2517..c4b36c88 100644
--- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml
+++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
@@ -56,6 +56,7 @@
+