diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index c3b5331e..0d0f8565 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -265,6 +265,9 @@
Resources\Img\LeftMainContent\HoverMenu_16x.png
+
+ Resources\Img\LeftMainContent\Image_16x.png
+
Resources\Img\LeftMainContent\ImageBrowser_16x.png
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index f03fb5a0..4c0b20e3 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -265,6 +265,9 @@
Resources\Img\LeftMainContent\HoverMenu_16x.png
+
+ Resources\Img\LeftMainContent\Image_16x.png
+
Resources\Img\LeftMainContent\ImageBrowser_16x.png
diff --git a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj
index f17655ca..dbbb46a4 100644
--- a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj
+++ b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj
@@ -138,6 +138,9 @@
UserControl\Controls\ImageBrowserDemoCtl.xaml
+
+ UserControl\Controls\ImageSelectorDemoCtl.xaml
+
UserControl\Controls\LoadingDemoCtl.xaml
@@ -523,6 +526,10 @@
UserControl\Controls\ImageBrowserDemoCtl.xaml.cs
ImageBrowserDemoCtl.xaml
+
+ UserControl\Controls\ImageSelectorDemoCtl.xaml.cs
+ ImageSelectorDemoCtl.xaml
+
UserControl\Controls\LoadingDemoCtl.xaml.cs
LoadingDemoCtl.xaml
diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
index 7ee1eeb7..3f16bf4a 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
+++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
@@ -27,7 +27,7 @@
[ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "" ],
[ "Menu", "MenuDemoCtl", "ContextMenu_16x", "" ],
[ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "" ],
- [ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "1" ],
+ [ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "" ],
[ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ],
[ "Border", "BorderDemoCtl", "BorderElement_16x", "" ],
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
@@ -41,6 +41,7 @@
"demoItemList": [
[ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ],
[ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1" ],
+ [ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "1" ],
[ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ],
[ "Magnifier", "MagnifierDemoCtl", "Search_16x", "" ],
[ "Gravatar", "GravatarDemoCtl", "User_16x", "" ],
diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index 27573381..0e17de7f 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -55,6 +55,9 @@
TextDialogWithTimer.xaml
+
+ ImageSelectorDemoCtl.xaml
+
AnimationPathDemoCtl.xaml
@@ -512,6 +515,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
index d6b6456b..41e738c9 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -851,7 +851,18 @@ namespace HandyControlDemo.Properties.Langs {
return ResourceManager.GetString("ImageBrowser", resourceCulture);
}
}
-
+
+ ///
+ /// 查找类似 图片选择器 的本地化字符串。
+ ///
+ public static string ImageSelector
+ {
+ get
+ {
+ return ResourceManager.GetString("ImageSelector", resourceCulture);
+ }
+ }
+
///
/// 查找类似 索引 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index 0f8f8540..c732de69 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
index f176e3e2..55d816c1 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
index 1f15b560..c8d40632 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
index fe9f13ee..145d2134 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
index e876c1bc..1035e112 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
@@ -753,4 +753,7 @@
属性编辑器
+
+ 图片选择器
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx
index 0f8f8540..c732de69 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx
index f0fb5b5c..988e40aa 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx
@@ -753,4 +753,7 @@
PropertyGrid
+
+ ImageSelector
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs
index e031d4b3..9a7df866 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs
@@ -125,7 +125,8 @@ namespace HandyControlDemo.Properties.Langs
OnPropertyChanged(nameof(Ignore));
OnPropertyChanged(nameof(ImageBlock));
OnPropertyChanged(nameof(ImageBrowser));
- OnPropertyChanged(nameof(Index));
+ OnPropertyChanged(nameof(ImageSelector));
+ OnPropertyChanged(nameof(Index));
OnPropertyChanged(nameof(Info));
OnPropertyChanged(nameof(InteractiveDialog));
OnPropertyChanged(nameof(IsNotPhone));
@@ -691,6 +692,11 @@ namespace HandyControlDemo.Properties.Langs
///
public string ImageBrowser => Lang.ImageBrowser;
+ ///
+ /// 查找类似 图片选择器 的本地化字符串。
+ ///
+ public string ImageSelector => Lang.ImageSelector;
+
///
/// 查找类似 索引 的本地化字符串。
///
@@ -1760,6 +1766,11 @@ namespace HandyControlDemo.Properties.Langs
///
public static string ImageBrowser = nameof(ImageBrowser);
+ ///
+ /// 查找类似 图片选择器 的本地化字符串。
+ ///
+ public static string ImageSelector = nameof(ImageSelector);
+
///
/// 查找类似 索引 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Image_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Image_16x.png
new file mode 100644
index 00000000..b6084a35
Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Image_16x.png differ
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml
new file mode 100644
index 00000000..a3286d5b
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml.cs
new file mode 100644
index 00000000..b71a7746
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ImageSelectorDemoCtl.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.UserControl
+{
+ public partial class ImageSelectorDemoCtl
+ {
+ public ImageSelectorDemoCtl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
index 637f5961..cf4160b3 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
@@ -44,7 +44,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs
index 65d6519d..3ddd5898 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs
@@ -2,7 +2,6 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
-using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Data;
using HandyControlDemo.ViewModel;
@@ -87,20 +86,5 @@ namespace HandyControlDemo.UserControl
}
}
}
-
- private void SearchBar_OnTextChanged(object sender, TextChangedEventArgs e)
- {
- if (e.OriginalSource is SearchBar searchBar)
- {
- _searchKey = searchBar.Text;
- if (string.IsNullOrEmpty(_searchKey))
- {
- foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
- {
- item.IsVisible = true;
- }
- }
- }
- }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs b/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs
new file mode 100644
index 00000000..f6b34b8d
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using HandyControl.Data;
+
+namespace HandyControl.Controls
+{
+ public class ImageSelector : Control
+ {
+ public static readonly DependencyProperty UriProperty = DependencyProperty.Register(
+ "Uri", typeof(Uri), typeof(ImageSelector), new PropertyMetadata(default(Uri)));
+
+ public Uri Uri
+ {
+ get => (Uri) GetValue(UriProperty);
+ set => SetValue(UriProperty, value);
+ }
+
+ internal static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
+ "Source", typeof(ImageSource), typeof(ImageSelector), new PropertyMetadata(default(ImageSource)));
+
+ internal ImageSource Source
+ {
+ get => (ImageSource) GetValue(SourceProperty);
+ set => SetValue(SourceProperty, value);
+ }
+
+ public static readonly DependencyProperty IsPreviewEnabledProperty = DependencyProperty.Register(
+ "IsPreviewEnabled", typeof(bool), typeof(ImageSelector), new PropertyMetadata(ValueBoxes.FalseBox));
+
+ public bool IsPreviewEnabled
+ {
+ get => (bool) GetValue(IsPreviewEnabledProperty);
+ set => SetValue(IsPreviewEnabledProperty, value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs b/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs
index 0d5ea363..d7acb02e 100644
--- a/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs
@@ -73,7 +73,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty HidingHeightProperty = DependencyProperty.Register(
- "HidingHeight", typeof(double), typeof(GotoTop), new PropertyMetadata(default(double)));
+ "HidingHeight", typeof(double), typeof(GotoTop), new PropertyMetadata(ValueBoxes.Double0Box));
public double HidingHeight
{
diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs
index 37a5a2c6..1ac9e1ed 100644
--- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs
+++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty MaxTitleWidthProperty = DependencyProperty.Register(
- "MaxTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(default(double)));
+ "MaxTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box));
public double MaxTitleWidth
{
@@ -85,7 +85,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty MinTitleWidthProperty = DependencyProperty.Register(
- "MinTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(default(double)));
+ "MinTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box));
public double MinTitleWidth
{
diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs
index be9bfc25..3ef9888a 100644
--- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs
+++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs
@@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
+using HandyControl.Data;
namespace HandyControl.Controls
{
@@ -62,7 +63,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
- "IsReadOnly", typeof(bool), typeof(PropertyItem), new PropertyMetadata(default(bool)));
+ "IsReadOnly", typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsReadOnly
{
@@ -107,7 +108,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
- "IsSelected", typeof(bool), typeof(PropertyItem), new PropertyMetadata(default(bool)));
+ "IsSelected", typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSelected
{
@@ -116,7 +117,7 @@ namespace HandyControl.Controls
}
public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register(
- "IsExpandedEnabled", typeof(bool), typeof(PropertyItem), new PropertyMetadata(default(bool)));
+ "IsExpandedEnabled", typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsExpandedEnabled
{
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index f2dc54a6..3b30bb3a 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -31,6 +31,7 @@
+
@@ -436,6 +437,14 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ImageSelectorBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ImageSelectorBaseStyle.xaml
new file mode 100644
index 00000000..9e7d50cb
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ImageSelectorBaseStyle.xaml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ImageSelector.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ImageSelector.xaml
new file mode 100644
index 00000000..1f73e7bf
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/ImageSelector.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index 4eac3253..528eb309 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -88,6 +88,7 @@
+