add Loading doc
This commit is contained in:
1 parent
5d231fa915
commit
7bab4cd61a
9 files changed
+119
-11
No files matched your search
@@ -1,5 +1,27 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ImageBrowser 图片浏览器
|
||||
---
|
||||
|
||||
建设中
|
||||
可借助 `ImageBrowser` 简单地浏览单张图片.
|
||||
|
||||
```cs
|
||||
public class ImageBrowser : Window
|
||||
```
|
||||
|
||||
# 案例
|
||||
|
||||
构造函数传入图片地址后即可开始浏览图片:
|
||||
|
||||
```cs
|
||||
new ImageBrowser(new Uri("pack://application:,,,/Resources/Img/1.jpg")).Show()
|
||||
```
|
||||
|
||||

|
||||
|
||||
# 功能
|
||||
|
||||
功能面板截图如下:
|
||||
|
||||

|
||||
|
||||
从左到右功能依次为:`保存至本地`、`使用系统默认程序打开该图片`、`缩小图片`、`放大图片`、`原始大小`、`左转图片`、`右转图片`.
|
||||
@@ -1,5 +1,30 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ImageViewer 图片视图
|
||||
---
|
||||
|
||||
建设中
|
||||
`ImageViewer` 是 `ImageBrowser` 的核心构件,它可以作为独立的控件使用,无需弹窗。
|
||||
|
||||
```cs
|
||||
[TemplatePart(Name = ElementPanelMain, Type = typeof(Panel))]
|
||||
[TemplatePart(Name = ElementCanvasSmallImg, Type = typeof(Canvas))]
|
||||
[TemplatePart(Name = ElementBorderMove, Type = typeof(Border))]
|
||||
[TemplatePart(Name = ElementBorderBottom, Type = typeof(Border))]
|
||||
[TemplatePart(Name = ElementImageMain, Type = typeof(Image))]
|
||||
public class ImageViewer : Control
|
||||
```
|
||||
|
||||
# 属性
|
||||
|
||||
|属性|描述|默认值|备注|
|
||||
|-|-|-|-|
|
||||
|ShowImgMap|是否显示小地图|false||
|
||||
|ImageSource|图片资源|||
|
||||
|IsFullScreen|是否处于全屏显示中|false|||
|
||||
|
||||
# 案例
|
||||
|
||||
```xml
|
||||
<hc:ImageViewer Background="{DynamicResource SecondaryRegionBrush}" Width="600" Height="330" ImageSource="/HandyControlDemo;component/Resources/Img/1.jpg"/>
|
||||
```
|
||||
|
||||

|
||||
@@ -1,5 +1,54 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: Loading 加载条
|
||||
---
|
||||
|
||||
建设中
|
||||
耗时操作时显示动效,目前包含圆形和直线两种加载条。相关博文:[《WPF 控件库——仿制Windows10的进度条》](https://www.cnblogs.com/nabian/p/9288576.html)
|
||||
|
||||
```cs
|
||||
public abstract class LoadingBase : ContentControl
|
||||
```
|
||||
|
||||
```cs
|
||||
public class LoadingLine : LoadingBase
|
||||
```
|
||||
|
||||
```cs
|
||||
public class LoadingCircle : LoadingBase
|
||||
```
|
||||
|
||||
# LoadingBase 属性
|
||||
|
||||
|属性|描述|默认值|备注|
|
||||
|-|-|-|-|
|
||||
|IsRunning|是否处于加载|true||
|
||||
|DotCount|圆点数目|5||
|
||||
|DotInterval|圆点间隙|10||
|
||||
|DotBorderBrush|圆点边框颜色|||
|
||||
|DotBorderThickness|圆点边框粗细|0||
|
||||
|DotDiameter|圆点半径|6||
|
||||
|DotSpeed|一遍循环所用时间|4s||
|
||||
|DotDelayTime|各点的动画延迟|80ms|||
|
||||
|
||||
# LoadingCircle 属性
|
||||
|
||||
|属性|描述|默认值|备注|
|
||||
|-|-|-|-|
|
||||
|DotOffSet|圆点偏移|20||
|
||||
|NeedHidden|圆点运动中途是否需要隐藏|true|||
|
||||
|
||||
# 案例
|
||||
|
||||
```xml
|
||||
<StackPanel Width="600" Margin="32" VerticalAlignment="Center">
|
||||
<hc:LoadingLine/>
|
||||
<hc:LoadingLine Margin="0,30" Foreground="BlueViolet" Style="{StaticResource LoadingLineLarge}"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<hc:LoadingCircle/>
|
||||
<Border VerticalAlignment="Center" Margin="32,0,0,0" Background="{DynamicResource PrimaryBrush}" CornerRadius="10">
|
||||
<hc:LoadingCircle Style="{StaticResource LoadingCircleLight}" Margin="10"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
```
|
||||
|
||||

|
||||
+12
@@ -1,4 +1,16 @@
|
||||
// Custom styles.
|
||||
|
||||
.container:before{
|
||||
content: "";
|
||||
opacity: 0.1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
background: url(https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/cloud.png);
|
||||
}
|
||||
.posts-expand .post-body img {
|
||||
margin: 3px;
|
||||
display: inline;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
EventManager.RegisterClassHandler(typeof(DateTimePicker), GotFocusEvent, new RoutedEventHandler(OnGotFocus));
|
||||
KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(DateTimePicker), new FrameworkPropertyMetadata(KeyboardNavigationMode.Once));
|
||||
KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(DateTimePicker), new FrameworkPropertyMetadata(false));
|
||||
KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(DateTimePicker), new FrameworkPropertyMetadata(ValueBoxes.FalseBox));
|
||||
}
|
||||
|
||||
public DateTimePicker()
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
EventManager.RegisterClassHandler(typeof(TimePicker), GotFocusEvent, new RoutedEventHandler(OnGotFocus));
|
||||
KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(KeyboardNavigationMode.Once));
|
||||
KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(false));
|
||||
KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(ValueBoxes.FalseBox));
|
||||
}
|
||||
|
||||
public TimePicker()
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty NeedHiddenProperty = DependencyProperty.Register(
|
||||
"NeedHidden", typeof(bool), typeof(LoadingCircle),
|
||||
new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public bool NeedHidden
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
|
||||
"IsPlaying", typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(true, (o, args) =>
|
||||
"IsPlaying", typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
|
||||
{
|
||||
var ctl = (AnimationPath)o;
|
||||
var v = (bool)args.NewValue;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace HandyControl.Interactivity
|
||||
public abstract class TriggerAction : Animatable, IAttachedObject
|
||||
{
|
||||
public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.Register("IsEnabled",
|
||||
typeof(bool), typeof(TriggerAction), new FrameworkPropertyMetadata(true));
|
||||
typeof(bool), typeof(TriggerAction), new FrameworkPropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
private readonly Type _associatedObjectTypeConstraint;
|
||||
|
||||
|
||||
Reference in new issue
Block a user