From db69815545dddb7bbca42ad8f01601d908b36ef8 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sun, 12 Jan 2020 19:54:00 +0330 Subject: [PATCH 01/43] add missing controls --- .../attach/globalShortcut/index.md | 3 +++ .../handycontrol/attach/linkElement/index.md | 3 +++ .../attach/textBlockAttach/index.md | 3 +++ .../extend_controls/buttonGroup/index.md | 3 +++ .../extend_controls/card/index.md | 3 +++ .../extend_controls/divider/index.md | 3 +++ .../extend_controls/drawer/index.md | 3 +++ .../extend_controls/floatingBlock/index.md | 3 +++ .../extend_controls/grid/index.md | 3 +++ .../extend_controls/honeycombPanel/index.md | 3 +++ .../extend_controls/imageBlock/index.md | 3 +++ .../extend_controls/magnifier/index.md | 3 +++ .../extend_controls/notification/index.md | 3 +++ .../extend_controls/popTip/index.md | 3 +++ .../extend_controls/rangeSlider/index.md | 3 +++ .../extend_controls/relativePanel/index.md | 3 +++ .../extend_controls/runningBlock/index.md | 3 +++ .../extend_controls/sideMenu/index.md | 3 +++ .../extend_controls/splitButton/index.md | 3 +++ .../extend_controls/sprite/index.md | 3 +++ doc/source/handycontrol/langs/index.md | 2 +- doc/source/handycontrol/tools/effect/index.md | 3 +++ .../tools/hatchBrushGenerator/index.md | 3 +++ .../tools/morphingAnimation/index.md | 3 +++ doc/themes/next/_config.yml | 23 +++++++++++++++++++ 25 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 doc/source/handycontrol/attach/globalShortcut/index.md create mode 100644 doc/source/handycontrol/attach/linkElement/index.md create mode 100644 doc/source/handycontrol/attach/textBlockAttach/index.md create mode 100644 doc/source/handycontrol/extend_controls/buttonGroup/index.md create mode 100644 doc/source/handycontrol/extend_controls/card/index.md create mode 100644 doc/source/handycontrol/extend_controls/divider/index.md create mode 100644 doc/source/handycontrol/extend_controls/drawer/index.md create mode 100644 doc/source/handycontrol/extend_controls/floatingBlock/index.md create mode 100644 doc/source/handycontrol/extend_controls/grid/index.md create mode 100644 doc/source/handycontrol/extend_controls/honeycombPanel/index.md create mode 100644 doc/source/handycontrol/extend_controls/imageBlock/index.md create mode 100644 doc/source/handycontrol/extend_controls/magnifier/index.md create mode 100644 doc/source/handycontrol/extend_controls/notification/index.md create mode 100644 doc/source/handycontrol/extend_controls/popTip/index.md create mode 100644 doc/source/handycontrol/extend_controls/rangeSlider/index.md create mode 100644 doc/source/handycontrol/extend_controls/relativePanel/index.md create mode 100644 doc/source/handycontrol/extend_controls/runningBlock/index.md create mode 100644 doc/source/handycontrol/extend_controls/sideMenu/index.md create mode 100644 doc/source/handycontrol/extend_controls/splitButton/index.md create mode 100644 doc/source/handycontrol/extend_controls/sprite/index.md create mode 100644 doc/source/handycontrol/tools/effect/index.md create mode 100644 doc/source/handycontrol/tools/hatchBrushGenerator/index.md create mode 100644 doc/source/handycontrol/tools/morphingAnimation/index.md diff --git a/doc/source/handycontrol/attach/globalShortcut/index.md b/doc/source/handycontrol/attach/globalShortcut/index.md new file mode 100644 index 00000000..c926da69 --- /dev/null +++ b/doc/source/handycontrol/attach/globalShortcut/index.md @@ -0,0 +1,3 @@ +--- +title: GlobalShortcut +--- diff --git a/doc/source/handycontrol/attach/linkElement/index.md b/doc/source/handycontrol/attach/linkElement/index.md new file mode 100644 index 00000000..68031d07 --- /dev/null +++ b/doc/source/handycontrol/attach/linkElement/index.md @@ -0,0 +1,3 @@ +--- +title: LinkElement +--- diff --git a/doc/source/handycontrol/attach/textBlockAttach/index.md b/doc/source/handycontrol/attach/textBlockAttach/index.md new file mode 100644 index 00000000..7abd42f4 --- /dev/null +++ b/doc/source/handycontrol/attach/textBlockAttach/index.md @@ -0,0 +1,3 @@ +--- +title: TextBlockAttach +--- diff --git a/doc/source/handycontrol/extend_controls/buttonGroup/index.md b/doc/source/handycontrol/extend_controls/buttonGroup/index.md new file mode 100644 index 00000000..049e173b --- /dev/null +++ b/doc/source/handycontrol/extend_controls/buttonGroup/index.md @@ -0,0 +1,3 @@ +--- +title: ButtonGroup +--- diff --git a/doc/source/handycontrol/extend_controls/card/index.md b/doc/source/handycontrol/extend_controls/card/index.md new file mode 100644 index 00000000..877d2fd6 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/card/index.md @@ -0,0 +1,3 @@ +--- +title: Card +--- diff --git a/doc/source/handycontrol/extend_controls/divider/index.md b/doc/source/handycontrol/extend_controls/divider/index.md new file mode 100644 index 00000000..c0af413b --- /dev/null +++ b/doc/source/handycontrol/extend_controls/divider/index.md @@ -0,0 +1,3 @@ +--- +title: Divider +--- diff --git a/doc/source/handycontrol/extend_controls/drawer/index.md b/doc/source/handycontrol/extend_controls/drawer/index.md new file mode 100644 index 00000000..03c8a6ac --- /dev/null +++ b/doc/source/handycontrol/extend_controls/drawer/index.md @@ -0,0 +1,3 @@ +--- +title: Drawer +--- diff --git a/doc/source/handycontrol/extend_controls/floatingBlock/index.md b/doc/source/handycontrol/extend_controls/floatingBlock/index.md new file mode 100644 index 00000000..7eb12950 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/floatingBlock/index.md @@ -0,0 +1,3 @@ +--- +title: FloatingBlock +--- diff --git a/doc/source/handycontrol/extend_controls/grid/index.md b/doc/source/handycontrol/extend_controls/grid/index.md new file mode 100644 index 00000000..d52f1876 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/grid/index.md @@ -0,0 +1,3 @@ +--- +title: Grid +--- diff --git a/doc/source/handycontrol/extend_controls/honeycombPanel/index.md b/doc/source/handycontrol/extend_controls/honeycombPanel/index.md new file mode 100644 index 00000000..9189a4e7 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/honeycombPanel/index.md @@ -0,0 +1,3 @@ +--- +title: HoneycombPanel +--- diff --git a/doc/source/handycontrol/extend_controls/imageBlock/index.md b/doc/source/handycontrol/extend_controls/imageBlock/index.md new file mode 100644 index 00000000..004fee45 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/imageBlock/index.md @@ -0,0 +1,3 @@ +--- +title: ImageBlock +--- diff --git a/doc/source/handycontrol/extend_controls/magnifier/index.md b/doc/source/handycontrol/extend_controls/magnifier/index.md new file mode 100644 index 00000000..e9cd70d1 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/magnifier/index.md @@ -0,0 +1,3 @@ +--- +title: Magnifier +--- diff --git a/doc/source/handycontrol/extend_controls/notification/index.md b/doc/source/handycontrol/extend_controls/notification/index.md new file mode 100644 index 00000000..92b4119e --- /dev/null +++ b/doc/source/handycontrol/extend_controls/notification/index.md @@ -0,0 +1,3 @@ +--- +title: Notification +--- diff --git a/doc/source/handycontrol/extend_controls/popTip/index.md b/doc/source/handycontrol/extend_controls/popTip/index.md new file mode 100644 index 00000000..e28dfc77 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/popTip/index.md @@ -0,0 +1,3 @@ +--- +title: PopTip +--- diff --git a/doc/source/handycontrol/extend_controls/rangeSlider/index.md b/doc/source/handycontrol/extend_controls/rangeSlider/index.md new file mode 100644 index 00000000..d8671ff6 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/rangeSlider/index.md @@ -0,0 +1,3 @@ +--- +title: RangeSlider +--- diff --git a/doc/source/handycontrol/extend_controls/relativePanel/index.md b/doc/source/handycontrol/extend_controls/relativePanel/index.md new file mode 100644 index 00000000..81349147 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/relativePanel/index.md @@ -0,0 +1,3 @@ +--- +title: RelativePanel +--- diff --git a/doc/source/handycontrol/extend_controls/runningBlock/index.md b/doc/source/handycontrol/extend_controls/runningBlock/index.md new file mode 100644 index 00000000..474bc528 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/runningBlock/index.md @@ -0,0 +1,3 @@ +--- +title: RunningBlock +--- diff --git a/doc/source/handycontrol/extend_controls/sideMenu/index.md b/doc/source/handycontrol/extend_controls/sideMenu/index.md new file mode 100644 index 00000000..c7cc2051 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/sideMenu/index.md @@ -0,0 +1,3 @@ +--- +title: SideMenu +--- diff --git a/doc/source/handycontrol/extend_controls/splitButton/index.md b/doc/source/handycontrol/extend_controls/splitButton/index.md new file mode 100644 index 00000000..532fd314 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/splitButton/index.md @@ -0,0 +1,3 @@ +--- +title: SplitButton +--- diff --git a/doc/source/handycontrol/extend_controls/sprite/index.md b/doc/source/handycontrol/extend_controls/sprite/index.md new file mode 100644 index 00000000..59360979 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/sprite/index.md @@ -0,0 +1,3 @@ +--- +title: Sprite +--- diff --git a/doc/source/handycontrol/langs/index.md b/doc/source/handycontrol/langs/index.md index e33f0268..f5cc3916 100644 --- a/doc/source/handycontrol/langs/index.md +++ b/doc/source/handycontrol/langs/index.md @@ -21,7 +21,7 @@ title: 国际化 # 扩展 -控件库自带的语言包包括简体中文(zh-cn)、英文(en)、波斯语(fa)、法语(fr),默认为简体中文(zh-cn): +控件库自带的语言包包括简体中文(zh-cn)、英文(en)、波斯语(fa)、法语(fr),韩国人 (ko-kr) , 默认为简体中文(zh-cn): ![Langs](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/langs/Langs.png) diff --git a/doc/source/handycontrol/tools/effect/index.md b/doc/source/handycontrol/tools/effect/index.md new file mode 100644 index 00000000..a82e557d --- /dev/null +++ b/doc/source/handycontrol/tools/effect/index.md @@ -0,0 +1,3 @@ +--- +title: Effect +--- diff --git a/doc/source/handycontrol/tools/hatchBrushGenerator/index.md b/doc/source/handycontrol/tools/hatchBrushGenerator/index.md new file mode 100644 index 00000000..c3ab9e7e --- /dev/null +++ b/doc/source/handycontrol/tools/hatchBrushGenerator/index.md @@ -0,0 +1,3 @@ +--- +title: HatchBrushGenerator +--- diff --git a/doc/source/handycontrol/tools/morphingAnimation/index.md b/doc/source/handycontrol/tools/morphingAnimation/index.md new file mode 100644 index 00000000..206d5770 --- /dev/null +++ b/doc/source/handycontrol/tools/morphingAnimation/index.md @@ -0,0 +1,3 @@ +--- +title: MorphingAnimation +--- diff --git a/doc/themes/next/_config.yml b/doc/themes/next/_config.yml index a18b3b35..45aa02b9 100644 --- a/doc/themes/next/_config.yml +++ b/doc/themes/next/_config.yml @@ -175,13 +175,16 @@ menu: 尺寸: /sizes/ || 附加属性: default: /attach/ || + TextBlockAttach : /textBlockAttach/ || BackgroundSwitchElement 可切换背景的元素: /backgroundSwitchElement/ || BorderElement 具有边框的元素: /borderElement/ || DataGridAttach DataGrid专用: /dataGridAttach/ || EdgeElement 具有边界内容的元素: /edgeElement/ || + GlobalShortcut : /globalShortcut/ || IconElement 具有图标的元素: /iconElement/ || IconSwitchElement 可切换图标的元素: /iconSwitchElement/ || InfoElement 信息元素: /infoElement/ || + LinkElement : /linkElement/ || PanelElement 面板元素: /panelElement/ || PasswordBoxAttach 密码框专用: /passwordBoxAttach/ || StatusSwitchElement 可切换状态的元素: /statusSwitchElement/ || @@ -225,8 +228,10 @@ menu: default: /extend_controls/ || AnimationPath 动画路径: /animationPath/ || Badge 标记: /badge/ || + ButtonGroup : /buttonGroup/ || BlurWindow 背景模糊窗口: /blurWindow/ || CalendarWithClock 带有时钟的日历: /calendarWithClock/ || + Card : /card/ || Carousel 轮播: /carousel/ || ChatBubble 对话气泡: /chatBubble/ || CirclePanel 圆形布局: /circlePanel/ || @@ -240,30 +245,45 @@ menu: DatePicker 日期选择器: /datePicker/ || DateTimePicker 日期时间选择器: /dateTimePicker/ || Dialog 对话框: /dialog/ || + Divider : /divider/ || + Drawer : /drawer/ || FlipClock 翻页时钟: /flipClock/ || + FloatingBlock : /floatingBlock/ || GifImage Gif图片: /gifImage/ || GotoTop 回到顶部: /gotoTop/ || Gravatar 头像: /gravatar/ || + Grid : /grid/ || Growl 信息通知: /growl/ || + HoneycombPanel : /honeycombPanel/ || + ImageBlock : /imageBlock/ || ImageBrowser 图片浏览器: /imageBrowser/ || ImageViewer 图片视图: /imageViewer/ || Loading 加载条: /loading/ || + Magnifier : /magnifier/ || MessageBox 消息对话框: /messageBox/ || + Notification : /notification/ || NotifyIcon 托盘图标: /notifyIcon/ || NumericUpDown 数值选择控件: /numericUpDown/ || OutlineText 轮廓文本: /outlineText/ || Pagination 页码条: /pagination/ || PasswordBox 密码框: /passwordBox/ || + PopTip : /popTip/ || PopupWindow 弹出窗口: /popupWindow/ || PreviewSlider 预览滑块: /previewSlider/ || ProgressButton 进度按钮: /progressButton/ || + RangeSlider : /rangeSlider/ || RadioGroup 单选按钮组: /radioGroup/ || Rate 评分: /rate/ || + RelativePanel : /relativePanel/ || + RunningBlock : /runningBlock/ || ScrollViewer 滚动视图: /scrollViewer/ || SearchBar 搜索栏: /searchBar/ || Shield 徽章: /shield/ || + SideMenu : /sideMenu/ || SimpleItemsControl 简单项目控件: /simpleItemsControl/ || SimplePanel 简单面板: /simplePanel/ || + SplitButton : /splitButton/ || + Sprite : /sprite/ || StepBar 步骤条: /stepBar/ || TabControl 选项卡控件: /tabControl/ || Tag 标签: /tag/ || @@ -281,6 +301,9 @@ menu: InfoType: /InfoType/ || 工具和扩展: default: /tools/ || + HatchBrushGenerator : /hatchBrushGenerator/ || + Effect : /effect/ || + MorphingAnimation : /morphingAnimation/ || 国际化: default: /langs/ || From 2dd14139c8def0a1775da0d4613f891ec1969045 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Wed, 15 Jan 2020 21:07:36 +0330 Subject: [PATCH 02/43] add pinbox and statusbar --- doc/source/handycontrol/extend_controls/pinBox/index.md | 3 +++ doc/source/handycontrol/native_controls/seperator/index.md | 3 +++ doc/source/handycontrol/native_controls/statusBar/index.md | 3 +++ doc/themes/next/_config.yml | 3 +++ 4 files changed, 12 insertions(+) create mode 100644 doc/source/handycontrol/extend_controls/pinBox/index.md create mode 100644 doc/source/handycontrol/native_controls/seperator/index.md create mode 100644 doc/source/handycontrol/native_controls/statusBar/index.md diff --git a/doc/source/handycontrol/extend_controls/pinBox/index.md b/doc/source/handycontrol/extend_controls/pinBox/index.md new file mode 100644 index 00000000..2f0ef4cf --- /dev/null +++ b/doc/source/handycontrol/extend_controls/pinBox/index.md @@ -0,0 +1,3 @@ +--- +title: PinBox +--- diff --git a/doc/source/handycontrol/native_controls/seperator/index.md b/doc/source/handycontrol/native_controls/seperator/index.md new file mode 100644 index 00000000..d5c4eaa4 --- /dev/null +++ b/doc/source/handycontrol/native_controls/seperator/index.md @@ -0,0 +1,3 @@ +--- +title: Seperator +--- diff --git a/doc/source/handycontrol/native_controls/statusBar/index.md b/doc/source/handycontrol/native_controls/statusBar/index.md new file mode 100644 index 00000000..23fa3e6c --- /dev/null +++ b/doc/source/handycontrol/native_controls/statusBar/index.md @@ -0,0 +1,3 @@ +--- +title: StatusBar +--- diff --git a/doc/themes/next/_config.yml b/doc/themes/next/_config.yml index 45aa02b9..c05961c9 100644 --- a/doc/themes/next/_config.yml +++ b/doc/themes/next/_config.yml @@ -215,7 +215,9 @@ menu: RadioButton 单选按钮: /radioButton/ || RichTextBox 富文本框: /richTextBox/ || ScrollViewer 滚动视图: /scrollViewer/ || + Seperator: /seperator/ || Slider 滑块: /slider/ || + StatusBar: /statusBar/ || TabControl 选项卡控件: /tabControl/ || TextBlock 文本块: /textBlock/ || TextBox 文本框: /textBox/ || @@ -267,6 +269,7 @@ menu: OutlineText 轮廓文本: /outlineText/ || Pagination 页码条: /pagination/ || PasswordBox 密码框: /passwordBox/ || + PinBox: /pinBox/ || PopTip : /popTip/ || PopupWindow 弹出窗口: /popupWindow/ || PreviewSlider 预览滑块: /previewSlider/ || From c7f4449a41cdc0e3ebd464b34076794549f83877 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sat, 18 Jan 2020 18:45:58 +0330 Subject: [PATCH 03/43] add glowWindow --- doc/source/handycontrol/extend_controls/glowWindow/index.md | 3 +++ .../native_controls/flowDocumentScrollViewer/index.md | 3 +++ doc/themes/next/_config.yml | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 doc/source/handycontrol/extend_controls/glowWindow/index.md create mode 100644 doc/source/handycontrol/native_controls/flowDocumentScrollViewer/index.md diff --git a/doc/source/handycontrol/extend_controls/glowWindow/index.md b/doc/source/handycontrol/extend_controls/glowWindow/index.md new file mode 100644 index 00000000..bf0d4873 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/glowWindow/index.md @@ -0,0 +1,3 @@ +--- +title: GlowWindow +--- diff --git a/doc/source/handycontrol/native_controls/flowDocumentScrollViewer/index.md b/doc/source/handycontrol/native_controls/flowDocumentScrollViewer/index.md new file mode 100644 index 00000000..79addbe2 --- /dev/null +++ b/doc/source/handycontrol/native_controls/flowDocumentScrollViewer/index.md @@ -0,0 +1,3 @@ +--- +title: FlowDocumentScrollViewer +--- diff --git a/doc/themes/next/_config.yml b/doc/themes/next/_config.yml index c05961c9..d74c3c3a 100644 --- a/doc/themes/next/_config.yml +++ b/doc/themes/next/_config.yml @@ -204,6 +204,7 @@ menu: DataGrid 数据表格: /dataGrid/ || DatePicker 日期选择器: /datePicker/ || Expander 展开框: /expander/ || + FlowDocumentScrollViewer: /flowDocumentScrollViewer/ || GroupBox 分组框: /groupBox/ || Image 图片: /image/ || Label 标签: /label/ || @@ -253,6 +254,7 @@ menu: FloatingBlock : /floatingBlock/ || GifImage Gif图片: /gifImage/ || GotoTop 回到顶部: /gotoTop/ || + GlowWindow: /glowWindow/ || Gravatar 头像: /gravatar/ || Grid : /grid/ || Growl 信息通知: /growl/ || From 78ca0f165c4791efb04e713e38d36b0acd8d6754 Mon Sep 17 00:00:00 2001 From: guanguanchuangyu <3246907890@qq.com> Date: Tue, 28 Jan 2020 20:18:04 +0800 Subject: [PATCH 04/43] add native_control doc of RichTextBox RichTextBox --- .../native_controls/richTextBox/index.md | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/doc/source/handycontrol/native_controls/richTextBox/index.md b/doc/source/handycontrol/native_controls/richTextBox/index.md index ca12ad62..6e8e2621 100644 --- a/doc/source/handycontrol/native_controls/richTextBox/index.md +++ b/doc/source/handycontrol/native_controls/richTextBox/index.md @@ -1,5 +1,42 @@ --- -title: 建设中 +title: RichTextBox 富文本框 --- -建设中 \ No newline at end of file +# TextBoxBaseBaseStyle + +该样式属于文本框基础样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +案例: + +```xml + +``` + +# RichTextBoxBaseStyle:TextBoxBaseBaseStyle + +富文本框的基础样式,作为默认富文本框的基类样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用 + +案例: + +```xml + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml index 8d247656..43d45e3e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml @@ -8,14 +8,14 @@ \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs index f15e82a5..1e9fecf0 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs @@ -6,6 +6,7 @@ using System.Runtime.CompilerServices; #endif using System.Windows; using System.Windows.Markup; +using System.Windows.Media.Animation; using HandyControl.Controls; using HandyControl.Data; @@ -50,8 +51,12 @@ namespace HandyControl.Tools { SetSystemVersionInfo(config.SystemVersionInfo); SetLang(config.Lang); + SetTimelineFrameRate(config.TimelineFrameRate); } + public void SetTimelineFrameRate(int rate) => + Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata(rate)); + public void SetWindowDefaultStyle(object resourceKey = null) { var metadata = resourceKey == null diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs index 818df6bc..23f73766 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs @@ -148,5 +148,7 @@ namespace HandyControl.Tools public static IntPtr CreateHandle() => new WindowInteropHelper(new Window()).EnsureHandle(); public static IntPtr GetHandle(this Window window) => new WindowInteropHelper(window).EnsureHandle(); + + public static HwndSource GetHwndSource(this Window window) => HwndSource.FromHwnd(window.GetHandle()); } } diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs index c183fb44..971fe31d 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs @@ -42,6 +42,19 @@ namespace HandyControl.Tools.Interop NIIF_INFO = 0x00000001, NIIF_WARNING = 0x00000002, NIIF_ERROR = 0x00000003, + WM_ACTIVATE = 0x0006, + WM_QUIT = 0x0012, + WM_WINDOWPOSCHANGING = 0x0046, + WM_WINDOWPOSCHANGED = 0x0047, + WM_SETICON = 0x0080, + WM_NCCREATE = 0x0081, + WM_NCDESTROY = 0x0082, + WM_NCACTIVATE = 0x0086, + WM_NCRBUTTONDOWN = 0x00A4, + WM_NCRBUTTONUP = 0x00A5, + WM_NCRBUTTONDBLCLK = 0x00A6, + WM_NCUAHDRAWCAPTION = 0x00AE, + WM_NCUAHDRAWFRAME = 0x00AF, WM_KEYDOWN = 0x0100, WM_KEYUP = 0x0101, WM_SYSKEYDOWN = 0x0104, @@ -53,6 +66,7 @@ namespace HandyControl.Tools.Interop WM_RBUTTONUP = 0x0205, WM_CLIPBOARDUPDATE = 0x031D, WM_USER = 0x0400, + WS_VISIBLE = 0x10000000, MF_BYPOSITION = 0x400, MF_SEPARATOR = 0x800, TB_GETBUTTON = WM_USER + 23, @@ -61,7 +75,12 @@ namespace HandyControl.Tools.Interop VERTRES = 10, DESKTOPVERTRES = 117, LOGPIXELSX = 88, - LOGPIXELSY = 90; + LOGPIXELSY = 90, + SC_SIZE = 0xF000, + SC_MOVE = 0xF010, + SC_MINIMIZE = 0xF020, + SC_MAXIMIZE = 0xF030, + SC_RESTORE = 0xF120; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] internal class NOTIFYICONDATA @@ -230,7 +249,7 @@ namespace HandyControl.Tools.Interop STYLE = -16, EXSTYLE = -20 } - + internal enum GWLP { WNDPROC = -4, From 203fbb45417f11e65a2836916776fe84bbbdffb8 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sun, 2 Feb 2020 16:06:49 +0800 Subject: [PATCH 09/43] fixed #319 --- .../UserControl/Main/OverView.xaml | 2 +- .../Controls/Other/NotifyIcon.cs | 2 +- .../Tools/Interop/InteropMethods.cs | 5 +++++ .../Tools/Interop/InteropValues.cs | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml index 2b00d656..7284de08 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml @@ -7,7 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"> - + diff --git a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs index 831d7f22..cd15bd75 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs @@ -530,7 +530,7 @@ namespace HandyControl.Controls private void RegisterClass() { _windowClassName = $"HandyControl.Controls.NotifyIcon{Guid.NewGuid()}"; - var wndclass = new InteropValues.WNDCLASS + var wndclass = new InteropValues.WNDCLASS4ICON { style = 0, lpfnWndProc = _callback, diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs index 2af265bf..06bfb21d 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs @@ -244,6 +244,11 @@ namespace HandyControl.Tools.Interop [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] internal static extern short RegisterClass(InteropValues.WNDCLASS wc); + [SecurityCritical] + [SuppressUnmanagedCodeSecurity] + [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] + internal static extern short RegisterClass(InteropValues.WNDCLASS4ICON wc); + [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)] internal static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs index 971fe31d..eed8f91d 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs @@ -579,6 +579,21 @@ namespace HandyControl.Tools.Interop public string lpszClassName; } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + internal class WNDCLASS4ICON + { + public int style; + public WndProc lpfnWndProc; + public int cbClsExtra; + public int cbWndExtra; + public IntPtr hInstance; + public IntPtr hIcon; + public IntPtr hCursor; + public IntPtr hbrBackground; + public string lpszMenuName; + public string lpszClassName; + } + [StructLayout(LayoutKind.Sequential, Pack = 2)] internal struct BITMAPINFO { From f261f3199f8a6a12af4d894a72792e316336e01b Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 3 Feb 2020 15:45:57 +0800 Subject: [PATCH 10/43] fixed some bugs --- .../HandyControlDemo_Core30.csproj | 5 +++ .../HandyControlDemo_Net_40.csproj | 5 +++ .../HandyControlDemo_Net_GE45.csproj | 5 +++ .../HandyControlDemo_Shared/App.xaml.cs | 14 +++++++ .../Properties/App.config | 3 ++ .../Resources/Themes/Basic/Brushes.xaml | 18 ++++----- .../Tools/GeometryAnimationDemoCtl.xaml | 5 ++- .../Controls/Image/ImageBlock.cs | 35 +++++++++++++++++- .../Controls/Other/Carousel.cs | 34 ++++++++++++++++- .../Controls/Other/NotifyIcon.cs | 5 +-- .../Controls/Time/FlipClock/FlipClock.cs | 37 +++++++++++++++++-- 11 files changed, 147 insertions(+), 19 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Properties/App.config diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index 80a476b3..dc1bfbd0 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -483,6 +483,11 @@ Lang.Designer.cs + + + Properties\App.config + + Data\MessageToken.tt 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 98fcf4f6..b869564e 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -419,6 +419,11 @@ Lang.Designer.cs + + + Properties\App.config + + Resources\fabric-icons.ttf 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 2fd623be..f61370b1 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -488,6 +488,11 @@ Designer + + + Properties\App.config + + Resources\Img\LeftMainContent\RepeatButton_16x.png diff --git a/src/Shared/HandyControlDemo_Shared/App.xaml.cs b/src/Shared/HandyControlDemo_Shared/App.xaml.cs index 72e70341..d65ad0ee 100644 --- a/src/Shared/HandyControlDemo_Shared/App.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/App.xaml.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; +using System.Runtime; using System.Security.Authentication; using System.Threading; using System.Windows; @@ -21,6 +22,19 @@ namespace HandyControlDemo private static Mutex AppMutex; #pragma warning restore IDE0052 + public App() + { +#if !netle40 + var cachePath = $"{AppDomain.CurrentDomain.BaseDirectory}Cache"; + if (!Directory.Exists(cachePath)) + { + Directory.CreateDirectory(cachePath); + } + ProfileOptimization.SetProfileRoot(cachePath); + ProfileOptimization.StartProfile("Profile"); +#endif + } + protected override void OnStartup(StartupEventArgs e) { AppMutex = new Mutex(true, "HandyControlDemo", out var createdNew); diff --git a/src/Shared/HandyControlDemo_Shared/Properties/App.config b/src/Shared/HandyControlDemo_Shared/Properties/App.config new file mode 100644 index 00000000..49cc43e1 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/Properties/App.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Basic/Brushes.xaml b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Basic/Brushes.xaml index bcee168f..95654be8 100644 --- a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Basic/Brushes.xaml +++ b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Basic/Brushes.xaml @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml index ede0f570..bce845a2 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml @@ -27,7 +27,10 @@ - + + + + diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs index 11f3adcb..1093a4fe 100644 --- a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs @@ -23,13 +23,46 @@ namespace HandyControl.Controls private int _blockHeight; + private bool _isDisposed; + public ImageBlock() { _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render) { Interval = Interval }; - _dispatcherTimer.Tick += DispatcherTimer_Tick; + + IsVisibleChanged += ImageBlock_IsVisibleChanged; + } + + ~ImageBlock() => Dispose(); + + public void Dispose() + { + if (_isDisposed) return; + + IsVisibleChanged -= ImageBlock_IsVisibleChanged; + _dispatcherTimer.Stop(); + _isDisposed = true; + + GC.SuppressFinalize(this); + } + + private void ImageBlock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if(IsVisible) + { + _dispatcherTimer.Tick += DispatcherTimer_Tick; + if (IsPlaying) + { + _dispatcherTimer.Start(); + } + } + else + { + _dispatcherTimer.Stop(); + _dispatcherTimer.Tick -= DispatcherTimer_Tick; + } } private void UpdateDatas() diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs index 61cc89ad..47ac493a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs @@ -22,7 +22,7 @@ namespace HandyControl.Controls [ContentProperty("Items")] [TemplatePart(Name = ElementPanelPage, Type = typeof(Panel))] [TemplatePart(Name = ElementItemsControl, Type = typeof(ItemsPresenter))] - public class Carousel : ListBox + public class Carousel : ListBox, IDisposable { #region Constants @@ -33,6 +33,8 @@ namespace HandyControl.Controls #region Data + private bool _isDisposed; + private Panel _panelPage; private bool _appliedTemplate; @@ -119,6 +121,36 @@ namespace HandyControl.Controls CommandBindings.Add(new CommandBinding(ControlCommands.Selected, ButtonPages_OnClick)); Loaded += (s, e) => UpdatePageButtons(); + IsVisibleChanged += Carousel_IsVisibleChanged; + } + + ~Carousel() => Dispose(); + + public void Dispose() + { + if (_isDisposed) return; + + IsVisibleChanged -= Carousel_IsVisibleChanged; + _updateTimer.Stop(); + _isDisposed = true; + + GC.SuppressFinalize(this); + } + + private void Carousel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (_updateTimer == null) return; + + if (IsVisible) + { + _updateTimer.Tick += UpdateTimer_Tick; + _updateTimer.Start(); + } + else + { + _updateTimer.Stop(); + _updateTimer.Tick -= UpdateTimer_Tick; + } } protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) diff --git a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs index cd15bd75..6531ccf6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs @@ -93,10 +93,7 @@ namespace HandyControl.Controls if (Application.Current != null) Application.Current.Exit += (s, e) => Dispose(); } - ~NotifyIcon() - { - Dispose(false); - } + ~NotifyIcon() => Dispose(false); public void Init() { diff --git a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs index bd066e7d..d7d1fc0d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs @@ -8,6 +8,10 @@ namespace HandyControl.Controls { public class FlipClock : Control { + private readonly DispatcherTimer _dispatcherTimer; + + private bool _isDisposed; + public static readonly DependencyProperty NumberListProperty = DependencyProperty.Register( "NumberList", typeof(List), typeof(FlipClock), new PropertyMetadata(new List {0, 0, 0, 0, 0, 0})); @@ -44,12 +48,39 @@ namespace HandyControl.Controls public FlipClock() { - var dispatcherTimer = new DispatcherTimer + _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render) { Interval = TimeSpan.FromMilliseconds(200) }; - dispatcherTimer.Tick += DispatcherTimer_Tick; - dispatcherTimer.Start(); + + IsVisibleChanged += FlipClock_IsVisibleChanged; + } + + ~FlipClock() => Dispose(); + + public void Dispose() + { + if (_isDisposed) return; + + IsVisibleChanged -= FlipClock_IsVisibleChanged; + _dispatcherTimer.Stop(); + _isDisposed = true; + + GC.SuppressFinalize(this); + } + + private void FlipClock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (IsVisible) + { + _dispatcherTimer.Tick += DispatcherTimer_Tick; + _dispatcherTimer.Start(); + } + else + { + _dispatcherTimer.Stop(); + _dispatcherTimer.Tick -= DispatcherTimer_Tick; + } } private void DispatcherTimer_Tick(object sender, EventArgs e) => DisplayTime = DateTime.Now; From f652cc20ea8ed8a5fa225585088af787a39a7307 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 3 Feb 2020 15:57:26 +0800 Subject: [PATCH 11/43] Update RelativePanel.cs --- .../Controls/Panel/RelativePanel.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs index f2705d0e..7d4dffad 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs @@ -2,9 +2,11 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Windows; using System.Windows.Controls; +using System.Windows.Markup; using HandyControl.Data; namespace HandyControl.Controls @@ -63,6 +65,7 @@ namespace HandyControl.Controls public static void SetAlignLeftWith(DependencyObject element, UIElement value) => element.SetValue(AlignLeftWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignLeftWith(DependencyObject element) => (UIElement) element.GetValue(AlignLeftWithProperty); @@ -72,6 +75,7 @@ namespace HandyControl.Controls public static void SetAlignTopWith(DependencyObject element, UIElement value) => element.SetValue(AlignTopWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignTopWith(DependencyObject element) => (UIElement) element.GetValue(AlignTopWithProperty); @@ -81,6 +85,7 @@ namespace HandyControl.Controls public static void SetAlignRightWith(DependencyObject element, UIElement value) => element.SetValue(AlignRightWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignRightWith(DependencyObject element) => (UIElement) element.GetValue(AlignRightWithProperty); @@ -90,6 +95,7 @@ namespace HandyControl.Controls public static void SetAlignBottomWith(DependencyObject element, UIElement value) => element.SetValue(AlignBottomWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignBottomWith(DependencyObject element) => (UIElement) element.GetValue(AlignBottomWithProperty); @@ -103,6 +109,7 @@ namespace HandyControl.Controls public static void SetLeftOf(DependencyObject element, UIElement value) => element.SetValue(LeftOfProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetLeftOf(DependencyObject element) => (UIElement)element.GetValue(LeftOfProperty); @@ -112,6 +119,7 @@ namespace HandyControl.Controls public static void SetAbove(DependencyObject element, UIElement value) => element.SetValue(AboveProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAbove(DependencyObject element) => (UIElement)element.GetValue(AboveProperty); @@ -121,6 +129,7 @@ namespace HandyControl.Controls public static void SetRightOf(DependencyObject element, UIElement value) => element.SetValue(RightOfProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetRightOf(DependencyObject element) => (UIElement)element.GetValue(RightOfProperty); @@ -130,6 +139,7 @@ namespace HandyControl.Controls public static void SetBelow(DependencyObject element, UIElement value) => element.SetValue(BelowProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetBelow(DependencyObject element) => (UIElement) element.GetValue(BelowProperty); @@ -161,6 +171,7 @@ namespace HandyControl.Controls public static void SetAlignHorizontalCenterWith(DependencyObject element, UIElement value) => element.SetValue(AlignHorizontalCenterWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignHorizontalCenterWith(DependencyObject element) => (UIElement)element.GetValue(AlignHorizontalCenterWithProperty); @@ -170,6 +181,7 @@ namespace HandyControl.Controls public static void SetAlignVerticalCenterWith(DependencyObject element, UIElement value) => element.SetValue(AlignVerticalCenterWithProperty, value); + [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignVerticalCenterWith(DependencyObject element) => (UIElement)element.GetValue(AlignVerticalCenterWithProperty); From 0062c68847eaea4b3c8b2f83e995e06ab993ac3a Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 12:53:29 +0800 Subject: [PATCH 12/43] fixed #189 --- .../UserControl/Controls/NumericUpDownDemoCtl.xaml | 2 +- .../Controls/Input/NumericUpDown.cs | 8 +++++++- .../Themes/Styles/Base/NumericUpDownBaseStyle.xaml | 12 ++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml index 5036e772..7ac08446 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml @@ -7,7 +7,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs index 992adabf..d2e2b08b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs @@ -13,18 +13,23 @@ namespace HandyControl.Controls /// 数值选择控件 /// [TemplatePart(Name = ElementTextBox, Type = typeof(TextBox))] + [TemplatePart(Name = ElementErrorTip, Type = typeof(UIElement))] public class NumericUpDown : Control, IDataInput { #region Constants private const string ElementTextBox = "PART_TextBox"; + private const string ElementErrorTip = "PART_ErrorTip"; + #endregion Constants #region Data private TextBox _textBox; + private UIElement _errorTip; + private bool _updateText; #endregion Data @@ -77,6 +82,7 @@ namespace HandyControl.Controls base.OnApplyTemplate(); _textBox = GetTemplateChild(ElementTextBox) as TextBox; + _errorTip = GetTemplateChild(ElementErrorTip) as UIElement; if (_textBox != null) { @@ -105,7 +111,7 @@ namespace HandyControl.Controls private void TextBox_LostFocus(object sender, RoutedEventArgs e) { - if (IsError) return; + if (IsError && _errorTip != null) return; _textBox.Text = CurrentText; } diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml index c69f0993..ae0f1b99 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml @@ -158,10 +158,10 @@ - + - + @@ -169,7 +169,7 @@ - + @@ -225,10 +225,10 @@ - + - + @@ -236,7 +236,7 @@ - + From 3e9614d7e74aca69f301e28bd6a8e81eff523ca2 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:44:02 +0800 Subject: [PATCH 13/43] update PanelElement --- .../handycontrol/attach/panelElement/index.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/source/handycontrol/attach/panelElement/index.md b/doc/source/handycontrol/attach/panelElement/index.md index ca12ad62..9267ff42 100644 --- a/doc/source/handycontrol/attach/panelElement/index.md +++ b/doc/source/handycontrol/attach/panelElement/index.md @@ -1,5 +1,19 @@ --- -title: 建设中 +title: PanelElement 面板元素 --- -建设中 \ No newline at end of file +# 属性 + +| 名称 | 用途 | +|-|-| +| FluidMoveBehavior | 设置面板的流体移动方式 | + +# 使用案例 + +## FluidMoveBehavior 设置面板的流体移动方式 + +```xml + +``` + +当向面板容器中添加或移除元素时,就可以看到流体移动的动画效果。 \ No newline at end of file From 0609c89245a5618cb9cb274a987085f48c4a6656 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:44:19 +0800 Subject: [PATCH 14/43] add RectangleAttach --- .../attach/rectangleAttach/index.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/source/handycontrol/attach/rectangleAttach/index.md diff --git a/doc/source/handycontrol/attach/rectangleAttach/index.md b/doc/source/handycontrol/attach/rectangleAttach/index.md new file mode 100644 index 00000000..4999a04b --- /dev/null +++ b/doc/source/handycontrol/attach/rectangleAttach/index.md @@ -0,0 +1,19 @@ +--- +title: RectangleAttach Rectangle专用 +--- + +# 属性 + +| 名称 | 用途 | +|-|-| +| CornerRadius | 设置Rectangle圆角值 | + +# 使用案例 + +## CornerRadius 设置Rectangle圆角值 + +```xml + +``` + +![RectangleAttach.CornerRadius](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/RectangleAttach.CornerRadius.png) \ No newline at end of file From ab2993a793107cc0245109d7ce5db74c1ad1821d Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:44:45 +0800 Subject: [PATCH 15/43] add TextBlockAttach --- .../attach/textBlockAttach/index.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/source/handycontrol/attach/textBlockAttach/index.md diff --git a/doc/source/handycontrol/attach/textBlockAttach/index.md b/doc/source/handycontrol/attach/textBlockAttach/index.md new file mode 100644 index 00000000..bf355d3f --- /dev/null +++ b/doc/source/handycontrol/attach/textBlockAttach/index.md @@ -0,0 +1,21 @@ +--- +title: TextBlockAttach 文本块专用 +--- + +# 属性 + +| 名称 | 用途 | +|-|-| +| AutoTooltip | 设置是否自动显示工具提示 | + +# 使用案例 + +## AutoTooltip 设置是否自动显示工具提示 + +```xml + + + +``` + +![TextBlockAttach.AutoTooltip](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TextBlockAttach.AutoTooltip.png) \ No newline at end of file From 2b4fa8a8513d76e639a1df9a4cc048e24b91f5ba Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:45:07 +0800 Subject: [PATCH 16/43] update Converters --- doc/source/handycontrol/basic_xaml/converters/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/handycontrol/basic_xaml/converters/index.md b/doc/source/handycontrol/basic_xaml/converters/index.md index 33f62bde..6d256584 100644 --- a/doc/source/handycontrol/basic_xaml/converters/index.md +++ b/doc/source/handycontrol/basic_xaml/converters/index.md @@ -50,6 +50,14 @@ title: 转换器 该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[0/1],[0/1],[0/1],[0/1]`,4个以逗号分隔的值分别对应`CornerRadius`的`Left`、`Top`,`Right`,`Bottom`属性,当值为1则返回对应属性的值,否则返回0。 +# Double2GridLengthConverter + +该转换器会将`double`值转换为`GridLength`。 + +# DoubleMinConverter(内部使用) + +可以向该转换器提供一个字符串作为最小值(如果不提供,则最小值默认为0),当传入的值小于最小值时,返回最小值,否则返回传入的值。 + # Int2StrConverter 该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[字符串0];[字符串1];...[字符串n]`,转换器会将一个整型的值作为索引,来获取指定位置的字符串并返回。 From 77a399a1a6bb401f3ca48b71ab7a06e6feedadaa Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:45:27 +0800 Subject: [PATCH 17/43] update sizes --- doc/source/handycontrol/basic_xaml/sizes/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/handycontrol/basic_xaml/sizes/index.md b/doc/source/handycontrol/basic_xaml/sizes/index.md index e8b38ee2..2fbb6e0f 100644 --- a/doc/source/handycontrol/basic_xaml/sizes/index.md +++ b/doc/source/handycontrol/basic_xaml/sizes/index.md @@ -5,7 +5,7 @@ title: 尺寸 | 名称 | 类型 | 值 | 描述 | |-|-| | DefaultControlHeight | System.Double | 30 | 默认控件高度 | -| DefaultControlPadding | System.Windows.Thickness | 12,6 | 默认控件内边距 | +| DefaultControlPadding | System.Windows.Thickness | 10,6 | 默认控件内边距 | | DefaultInputPadding | System.Windows.Thickness | 8,6 |默认输入控件内边距 | | DefaultCornerRadius | System.Windows.CornerRadius | 4 | 默认圆角 | From b19436985c89e9cd1d5a85c3ae064fd8fa487ea3 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 15:45:43 +0800 Subject: [PATCH 18/43] Update _config.yml --- doc/themes/next/_config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/themes/next/_config.yml b/doc/themes/next/_config.yml index a18b3b35..59861b1e 100644 --- a/doc/themes/next/_config.yml +++ b/doc/themes/next/_config.yml @@ -158,7 +158,7 @@ baidu_push: false # External url should start with http:// or https:// menu: 主页: / || - HandyControl: + HandyControl - 2.4.0: default: /handycontrol/ || 鸣谢: /tnx/ || 快速开始: /quick_start/ || @@ -184,7 +184,9 @@ menu: InfoElement 信息元素: /infoElement/ || PanelElement 面板元素: /panelElement/ || PasswordBoxAttach 密码框专用: /passwordBoxAttach/ || + RectangleAttach Rectangle专用: /rectangleAttach/ || StatusSwitchElement 可切换状态的元素: /statusSwitchElement/ || + TextBlockAttach 文本块专用: /textBlockAttach/ || TipElement 提示元素: /tipElement/ || TitleElement 标题元素: /titleElement/ || VisualElement 可视化元素: /visualElement/ || From 44b6d64e0aa4397dea33d39e3ffa2bcde574ce83 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 4 Feb 2020 16:04:42 +0800 Subject: [PATCH 19/43] update ChatBox --- .../UserControl/Basic/ChatBox.xaml | 2 +- .../UserControl/Basic/ChatBox.xaml.cs | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml index 2615146f..c8e06311 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml @@ -16,7 +16,7 @@ - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs index affe29d0..10a70ab1 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs @@ -1,10 +1,27 @@ -namespace HandyControlDemo.UserControl +using System.Windows.Controls; +using HandyControl.Tools; + +namespace HandyControlDemo.UserControl { public partial class ChatBox { + private ScrollViewer _scrollViewer; + public ChatBox() { InitializeComponent(); + + ListBoxChat.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged; + } + + private void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e) + { + if (_scrollViewer == null) + { + _scrollViewer = VisualHelper.GetChild(ListBoxChat); + } + + _scrollViewer?.ScrollToBottom(); } } } From aa6587022baabf082a41dce1661da1c585a88c24 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Wed, 5 Feb 2020 17:44:02 +0800 Subject: [PATCH 20/43] merged pr --- .../native_controls/richTextBox/index.md | 33 ++++--------------- .../native_controls/scrollViewer/index.md | 10 ++---- .../native_controls/slider/index.md | 7 ++-- .../native_controls/tabControl/index.md | 26 +++++++-------- doc/themes/next/_config.yml | 2 +- .../analytics/cnzz-analytics.swig | 4 +-- 6 files changed, 23 insertions(+), 59 deletions(-) diff --git a/doc/source/handycontrol/native_controls/richTextBox/index.md b/doc/source/handycontrol/native_controls/richTextBox/index.md index 6e8e2621..3e33e5e1 100644 --- a/doc/source/handycontrol/native_controls/richTextBox/index.md +++ b/doc/source/handycontrol/native_controls/richTextBox/index.md @@ -4,39 +4,18 @@ title: RichTextBox 富文本框 # TextBoxBaseBaseStyle -该样式属于文本框基础样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 +基础文本控件默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +# RichTextBoxBaseStyle : TextBoxBaseBaseStyle + +富文本框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 案例: -```xml - -``` - -# RichTextBoxBaseStyle:TextBoxBaseBaseStyle - -富文本框的基础样式,作为默认富文本框的基类样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用 - -案例: - -```xml - + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml index e64aedab..eab4eb00 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml @@ -1,55 +1,9 @@ - + - - + - + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/FlowDocumentScrollViewerBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/FlowDocumentScrollViewerBaseStyle.xaml deleted file mode 100644 index dc226e95..00000000 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/FlowDocumentScrollViewerBaseStyle.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocument.xaml similarity index 63% rename from src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml rename to src/Shared/HandyControl_Shared/Themes/Styles/FlowDocument.xaml index eab4eb00..05cd66b0 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocument.xaml @@ -1,9 +1,11 @@  - + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/RadioButtonBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/RadioButtonBaseStyle.xaml index 26c893c6..9ca2f6f6 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/RadioButtonBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/RadioButtonBaseStyle.xaml @@ -174,7 +174,10 @@ - + + + + @@ -185,6 +188,13 @@ + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml index 138ffd03..20b02675 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml @@ -11,7 +11,7 @@ + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ImageViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ImageViewer.xaml index 75b651c9..9b18b384 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/ImageViewer.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/ImageViewer.xaml @@ -63,13 +63,7 @@ + + +