From 968cffe1bd53e26d702e279bdb0fb59b48fb25bd Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Wed, 19 Aug 2020 00:05:53 +0800 Subject: [PATCH] add RelativePanel, Rate, RunningBlock and ScrollViewer docs --- .../extend_controls/rate/index.md | 54 ++++++++++- .../extend_controls/relativePanel/index.md | 90 +++++++++++++++++- .../extend_controls/runningBlock/index.md | 45 ++++++++- .../extend_controls/scrollViewer/index.md | 92 ++++++++++++++++++- .../next/source/css/_custom/custom.styl | 18 ++++ 5 files changed, 293 insertions(+), 6 deletions(-) diff --git a/doc/source/handycontrol/extend_controls/rate/index.md b/doc/source/handycontrol/extend_controls/rate/index.md index ca12ad62..8e8d9fd9 100644 --- a/doc/source/handycontrol/extend_controls/rate/index.md +++ b/doc/source/handycontrol/extend_controls/rate/index.md @@ -1,5 +1,55 @@ --- -title: 建设中 +title: Rate 评分 --- -建设中 \ No newline at end of file +当对评价进行展示或对事物进行快速的评级操作时,可使用评分控件. + +```cs +[DefaultProperty("Items")] +[ContentProperty("Items")] +[TemplatePart(Name = ElementPanel, Type = typeof(Panel))] +public class SimpleItemsControl : Control +``` + +```cs +public class RegularItemsControl : SimpleItemsControl +``` + +```cs +public class Rate : RegularItemsControl +``` + +# 属性 + +|属性|描述|默认值|备注| +|-|-|-|-| +|AllowHalf|是否允许半选|false|| +|AllowClear|是否允许再次点击后清除|true|| +|Icon|图标||| +|Count|star 总数|5|| +|DefaultValue|默认值|0|| +|Value|当前评分|0|| +|Text|评分文字||| +|ShowText|是否显示评分文字|false|| +|IsReadOnly|是否只读|false|| +|Value|当前评分|0||| + +# 事件 + +|名称|说明| +|-|-| +| ValueChanged | 评分改变时触发 | + +# 案例 + +```xml + + + + + + + +``` + +![Rate](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Rate.png) \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/relativePanel/index.md b/doc/source/handycontrol/extend_controls/relativePanel/index.md index 81349147..6b4b940a 100644 --- a/doc/source/handycontrol/extend_controls/relativePanel/index.md +++ b/doc/source/handycontrol/extend_controls/relativePanel/index.md @@ -1,3 +1,91 @@ --- -title: RelativePanel +title: RelativePanel 相对布局 --- + +可以使用 `RelativePanel` 的附加属性对其内容进行相对布局. +详见:[RelativePanel Class](https://docs.microsoft.com/zh-cn/uwp/api/Windows.UI.Xaml.Controls.RelativePanel) + +```cs +public class RelativePanel : Panel +``` + +# 属性 + +|属性|描述|默认值|备注| +|-|-|-|-| +|Above|使此元素位于目标元素的上方||| +|AlignBottomWith|使此元素与目标元素底部对齐||| +|AlignBottomWithPanel|使此元素与Panel底部对齐|false|| +|AlignHorizontalCenterWith|使此元素与目标元素水平居中对齐||| +|AlignHorizontalCenterWithPanel|使此元素与Panel水平居中对齐|false|| +|AlignLeftWith|使此元素与目标元素左侧对齐||| +|AlignLeftWithPanel|使此元素与Panel左侧对齐|false|| +|AlignRightWith|使此元素与目标元素右侧对齐||| +|AlignRightWithPanel|使此元素与Panel右侧对齐|false|| +|AlignTopWith|使此元素与目标元素顶部对齐||| +|AlignTopWithPanel|使此元素与Panel顶侧对齐|false|| +|AlignVerticalCenterWith|使此元素与目标元素垂直居中对齐||| +|AlignVerticalCenterWithPanel|使此元素与Panel垂直居中对齐|false|| +|Below|使此元素位于目标元素的下方||| +|LeftOf|使此元素位于目标元素的左侧||| +|RightOf|使此元素位于目标元素的右侧|||| + +# 案例 + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +![RelativePanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RelativePanel.png) \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/runningBlock/index.md b/doc/source/handycontrol/extend_controls/runningBlock/index.md index 474bc528..b63562c3 100644 --- a/doc/source/handycontrol/extend_controls/runningBlock/index.md +++ b/doc/source/handycontrol/extend_controls/runningBlock/index.md @@ -1,3 +1,46 @@ --- -title: RunningBlock +title: RunningBlock 滚动块 --- + +滚动块可用于对连续性内容进行轮播. + +```cs +[TemplatePart(Name = ElementContent, Type = typeof(FrameworkElement))] +[TemplatePart(Name = ElementPanel, Type = typeof(Panel))] +public class RunningBlock : ContentControl +``` + +|属性|描述|默认值|备注| +|-|-|-|-| +|Runaway|滚动内容是否可以脱离视野|true|| +|AutoRun|是否自动触发滚动|false|当显示区域不够时才触发滚动| +|Orientation|滚动方向|Orientation.Horizontal|| +|Duration|滚动一个周期需要的时间|5s|| +|Speed|滚动速度|NaN|如果设定了值,则会覆盖Duration的值| +|IsRunning|是否处于滚动中|true|| +|AutoReverse|是否反转滚动|false||| + +# 案例 + +```xml + + + + + + + + + + + + + + + + + + +``` + +![RunningBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RunningBlock.gif) \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/scrollViewer/index.md b/doc/source/handycontrol/extend_controls/scrollViewer/index.md index ca12ad62..0d226924 100644 --- a/doc/source/handycontrol/extend_controls/scrollViewer/index.md +++ b/doc/source/handycontrol/extend_controls/scrollViewer/index.md @@ -1,5 +1,93 @@ --- -title: 建设中 +title: ScrollViewer 滚动视图 --- -建设中 \ No newline at end of file +对原生滚动视图的扩展. + +```cs +public class ScrollViewer : System.Windows.Controls.ScrollViewer +``` + +# 属性 + +|属性|描述|默认值|备注| +|-|-|-|-| +|Orientation|滚动方向|Orientation.Vertical|| +|CanMouseWheel|是否响应鼠标滚轮操作|true|| +|IsInertiaEnabled|是否支持惯性滚动|false|| +|IsPenetrating|是否可以穿透点击|false||| + +# 案例 + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +![ScrollViewer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/ScrollViewer.gif) \ No newline at end of file diff --git a/doc/themes/next/source/css/_custom/custom.styl b/doc/themes/next/source/css/_custom/custom.styl index d8dd144d..cff32efb 100644 --- a/doc/themes/next/source/css/_custom/custom.styl +++ b/doc/themes/next/source/css/_custom/custom.styl @@ -1,5 +1,23 @@ // Custom styles. +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; + background: #bdbdbd; +} + +::-webkit-scrollbar-thumb:hover { + background: #757575; +} + +::-webkit-scrollbar-thumb:active { + background: #212121; +} + .header-inner { box-shadow: 0 4px 8px 1.5px rgba(0,0,0,0.15); border-radius: 0 0 10px 10px;