From 02e8fc4a1361216303f06862f7df421e2e2dd51a Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Thu, 16 Jan 2020 23:49:02 +0800 Subject: [PATCH] add FlowDocumentScrollViewer style --- README.md | 8 +- .../HandyControlDemo_Core30.csproj | 3 + .../HandyControlDemo_Net_40.csproj | 3 + .../HandyControlDemo_Net_GE45.csproj | 3 + .../Data/DemoInfo.json | 1 + .../HandyControlDemo_Shared.projitems | 7 ++ .../Properties/Langs/Lang.Designer.cs | 9 ++ .../Properties/Langs/Lang.en.resx | 3 + .../Properties/Langs/Lang.fa.resx | 3 + .../Properties/Langs/Lang.fr.resx | 3 + .../Properties/Langs/Lang.ko-KR.resx | 3 + .../Properties/Langs/Lang.resx | 3 + .../LeftMainContent/WPFFlowDocument_16x.png | Bin 0 -> 315 bytes .../Controls/RangeSliderDemoCtl.xaml | 8 +- .../FlowDocumentScrollViewerDemoCtl.xaml | 101 ++++++++++++++++++ .../FlowDocumentScrollViewerDemoCtl.xaml.cs | 10 ++ .../UserControl/Styles/SliderDemoCtl.xaml | 8 +- .../Controls/Attach/TipElement.cs | 9 ++ .../HandyControl_Shared.projitems | 4 + .../Properties/Langs/Lang.Designer.cs | 18 ++++ .../Properties/Langs/Lang.en.resx | 6 ++ .../Properties/Langs/Lang.fa.resx | 6 ++ .../Properties/Langs/Lang.fr.resx | 6 ++ .../Properties/Langs/Lang.ko-KR.resx | 6 ++ .../Properties/Langs/Lang.resx | 6 ++ .../Themes/Styles/Base/SliderBaseStyle.xaml | 32 +++--- .../Styles/FlowDocumentScrollViewer.xaml | 55 ++++++++++ .../Themes/Styles/Style.xaml | 1 + 28 files changed, 299 insertions(+), 26 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml diff --git a/README.md b/README.md index 15c92ccd..f2aeea26 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,10 @@ Step 4:enjoy coding ## Latest examples +### FlowDocumentScrollViewerStyle + +![FlowDocumentScrollViewerStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FlowDocumentScrollViewer.png) + ### PinBox ![PinBox](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/PinBox.png) @@ -113,12 +117,12 @@ Step 4:enjoy coding ![Drawer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Drawer.gif) +## History publication + ### Poptip ![Poptip](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Poptip.gif) -## History publication - ### Divider ![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png) diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index b3c41945..f91f3b1d 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -457,6 +457,9 @@ Resources\Img\LeftMainContent\Ellipsis_16x.png + + Resources\Img\LeftMainContent\WPFFlowDocument_16x.png + 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 d2ee3658..bba16269 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -523,6 +523,9 @@ Resources\Img\LeftMainContent\Ellipsis_16x.png + + Resources\Img\LeftMainContent\WPFFlowDocument_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 9b86a79e..94a32b27 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -586,6 +586,9 @@ Resources\Img\LeftMainContent\Ellipsis_16x.png + + Resources\Img\LeftMainContent\WPFFlowDocument_16x.png + diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index e10713f7..09201d74 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -26,6 +26,7 @@ [ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "" ], [ "Menu", "MenuDemoCtl", "ContextMenu_16x", "" ], [ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "" ], + [ "FlowDocumentScrollViewer", "FlowDocumentScrollViewerDemoCtl", "WPFFlowDocument_16x", "1" ], [ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ], [ "Border", "BorderDemoCtl", "BorderElement_16x", "" ], [ "Label", "LabelDemoCtl", "Label_16x", "" ] diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index e9b3c59e..17fed60e 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -293,6 +293,9 @@ ExpanderDemoCtl.xaml + + FlowDocumentScrollViewerDemoCtl.xaml + GroupBoxDemoCtl.xaml @@ -800,6 +803,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 7c2eff9a..0a7a2898 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -627,6 +627,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 流文档滚动视图 的本地化字符串。 + /// + public static string FlowDocumentScrollViewer { + get { + return ResourceManager.GetString("FlowDocumentScrollViewer", resourceCulture); + } + } + /// /// 查找类似 Gif图片 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 82034ede..eec92d63 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -714,4 +714,7 @@ PinBox + + FlowDocumentScrollViewer + \ 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 d6102272..17f72064 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -714,4 +714,7 @@ PinBox + + FlowDocumentScrollViewer + \ 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 95a79a20..2a9f70e6 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -714,4 +714,7 @@ PinBox + + FlowDocumentScrollViewer + \ 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 6c0bf75a..b16ff604 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx @@ -714,4 +714,7 @@ PinBox + + FlowDocumentScrollViewer + \ 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 e5d2b80e..45a4e46c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -714,4 +714,7 @@ PIN码框 + + 流文档滚动视图 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..605a4f49da56b69d077f1791232d5920b8b2ece6 GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAQ1Gp% zi(^Pd+|uCPyv+t8TY9Bq44vE(SgTy7qzKMnF+0KHDdnZ&#-W|Utfgi5(bGbyvMi?H z(qvuxyL+uqKRdl?gYAPfW1eRJm6xY#EUhv*ldw^BN#?6Ht5zlXW_(?6c$)G}{&(Bi zC2RN1iMVWX<5=Z9`>h^K?nfHg1sW%F_?1lLNYOf_wn*@%@&yZ(X@XxZ6qQkomLK(uwT+=ZD)w5IrcjyN|a?3oU`Bmk$2|2oY_T__lE;L&fw|l K=d#Wzp$Py$p>)~+ literal 0 HcmV?d00001 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml index 0dd0f1b7..8f4f3b99 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml @@ -8,14 +8,14 @@ - - + + - - + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml new file mode 100644 index 00000000..f6c8c9c3 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml @@ -0,0 +1,101 @@ + + + + +
+ + Neptune (planet), major planet in the solar system, eighth planet + from the Sun and fourth largest in diameter. Neptune maintains an almost constant + distance, about 4,490 million km (about 2,790 million mi), from the Sun. Neptune + revolves outside the orbit of Uranus and for most of its orbit moves inside the + elliptical path of the outermost planet Pluto (see Solar System). Every 248 years, + Pluto’s elliptical orbit brings the planet inside Neptune’s nearly circular orbit + for about 20 years, temporarily making Neptune the farthest planet from the Sun. + The last time Pluto’s orbit brought it inside Neptune’s orbit was in 1979. In + 1999 Pluto’s orbit carried it back outside Neptune’s orbit. +
+ + Neptune has 72 times Earth's volume... + +
+ + + + + + + + + + Neptune Stats + + + + + Mean Distance from Sun + + + 4,504,000,000 km + + + + + Mean Diameter + + + 49,532 km + + + + + Approximate Mass + + + 1.0247e26 kg + + + + + + Information from the + Encarta + web site. + + + + +
+
+
+ + Astronomers believe Neptune has an inner rocky core that is surrounded by a vast + ocean of water mixed with rocky material. From the inner core, this ocean extends + upward until it meets a gaseous atmosphere of hydrogen, helium, and trace amounts + of methane. Neptune has four rings and 11 known moons. Even though Neptune's volume + is 72 times Earth’s volume, its mass is only 17.15 times Earth’s mass. Because of + its size, scientists classify Neptune—along with Jupiter, Saturn, and Uranus—as + one of the giant or Jovian planets (so-called because they resemble Jupiter). + + +
+ + Neptune has an orbital period of ~20 years... + +
+ Mathematical theories of astronomy led to the discovery of Neptune. To account for + wobbles in the orbit of the planet Uranus, British astronomer John Couch Adams and + French astronomer Urbain Jean Joseph Leverrier independently calculated the existence + and position of a new planet in 1845 and 1846, respectively. They theorized that the + gravitational attraction of this planet for Uranus was causing the wobbles in Uranus’s + orbit. Using information from Leverrier, German astronomer Johann Gottfried Galle first + observed the planet in 1846. +
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs new file mode 100644 index 00000000..0ebfaccf --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class FlowDocumentScrollViewerDemoCtl + { + public FlowDocumentScrollViewerDemoCtl() + { + InitializeComponent(); + } + } +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml index 06347065..1094c1f5 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml @@ -9,15 +9,15 @@ - - + + - - + + diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs index 5fa5481f..86777414 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs @@ -18,5 +18,14 @@ namespace HandyControl.Controls public static void SetPlacement(DependencyObject element, TipPlacement value) => element.SetValue(PlacementProperty, value); public static TipPlacement GetPlacement(DependencyObject element) => (TipPlacement) element.GetValue(PlacementProperty); + + public static readonly DependencyProperty StringFormatProperty = DependencyProperty.RegisterAttached( + "StringFormat", typeof(string), typeof(TipElement), new PropertyMetadata("#0.0")); + + public static void SetStringFormat(DependencyObject element, string value) + => element.SetValue(StringFormatProperty, value); + + public static string GetStringFormat(DependencyObject element) + => (string) element.GetValue(StringFormatProperty); } } \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems index 95008f3d..cb8ba292 100644 --- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems +++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems @@ -394,6 +394,10 @@ Designer MSBuild:Compile
+ + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs index d9db4d8d..cc31cac1 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs @@ -320,5 +320,23 @@ namespace HandyControl.Properties.Langs { return ResourceManager.GetString("Yes", resourceCulture); } } + + /// + /// 查找类似 放大 的本地化字符串。 + /// + public static string ZoomIn { + get { + return ResourceManager.GetString("ZoomIn", resourceCulture); + } + } + + /// + /// 查找类似 缩小 的本地化字符串。 + /// + public static string ZoomOut { + get { + return ResourceManager.GetString("ZoomOut", resourceCulture); + } + } } } diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx index 28b6a0dc..4992c864 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx @@ -184,4 +184,10 @@ No + + Zoom in + + + Zoom out + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx index 58de5d70..166a0b08 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx @@ -184,4 +184,10 @@ خیر + + Zoom in + + + Zoom out + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx index f616fa21..c400a1f2 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx @@ -204,4 +204,10 @@ Non + + Zoom in + + + Zoom out + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx index 295d0acb..2579b146 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx @@ -204,4 +204,10 @@ 네 + + Zoom in + + + Zoom out + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx index 76827085..679dd9bb 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx @@ -184,4 +184,10 @@ 否 + + 放大 + + + 缩小 + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml index 9d71bc2a..d371ad3a 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml @@ -72,7 +72,7 @@ - @@ -103,7 +103,7 @@ - @@ -134,7 +134,7 @@ - @@ -165,7 +165,7 @@ - @@ -223,14 +223,14 @@ - + - + @@ -280,14 +280,14 @@ - + - + @@ -709,7 +709,7 @@ - @@ -740,7 +740,7 @@ - @@ -771,7 +771,7 @@ - @@ -802,7 +802,7 @@ - @@ -862,7 +862,7 @@ - + @@ -870,7 +870,7 @@ - + @@ -920,7 +920,7 @@ - + @@ -928,7 +928,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml new file mode 100644 index 00000000..e64aedab --- /dev/null +++ b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + \ 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 063d9132..5a7386e4 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml @@ -81,6 +81,7 @@ + \ No newline at end of file