关于 syncfusion-wpf-circular-progressbar
用于在 WPF 中实现 Syncfusion SfCircularProgressBar 的技能,涵盖进度状态、分段与缓冲指示、圆弧样式及环形中央的自定义内容。
主要功能
- 01显示确定或不确定进度
- 02显示次级缓冲进度
- 03将进度环划分为多个区段
- 04自定义圆弧角度、颜色和渐变
- 05在中央放置自定义内容
适用场景
- 01显示文件上传进度
- 02呈现加载动画
- 03构建分段式步骤跟踪器
- 04创建半圆仪表
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ syncfusion/ wpf-ui-components-skills --skill syncfusion-wpf-circular-progressbar安装后在 Claude Code 中输入/syncfusion-wpf-circular-progressbar确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/appearance.mdgetting-started.mdsegments-and-custom-content.mdstates.md详细介绍
实现 SfCircularProgressBar(WPF)
何时使用此技能
在以下情况下使用此技能:
- 显示已知任务的圆形/径向进度(确定进度)
- 在进度未知时显示不确定进度的旋转指示器
- 同时显示主要进度和次要(缓冲)进度
- 将进度拆分为多个片段(例如,工作流中的各个步骤)
- 自定义弧形角度(半圆、整圆、部分弧形)
- 设置进度环的颜色、渐变或基于范围的颜色
- 在环的中心放置自定义内容(文本、按钮、图像)
程序集: Syncfusion.SfProgressBar.WPF
命名空间: Syncfusion.UI.Xaml.ProgressBar
XAML 架构: http://schemas.syncfusion.com/wpf
核心类: SfCircularProgressBar
快速入门
<Window
xmlns:Syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<Syncfusion:SfCircularProgressBar
Progress="70"
ShowProgressValue="True"
Width="150" Height="150" />
</Grid>
</Window>
using Syncfusion.UI.Xaml.ProgressBar;
SfCircularProgressBar circular = new SfCircularProgressBar();
circular.Progress = 70;
circular.ShowProgressValue = true;
circular.Width = 150;
grid.Children.Add(circular);
文档与导航指南
入门
📄 阅读: references/getting-started.md
- NuGet/程序集安装(
Syncfusion.SfProgressBar.WPF) - XAML 命名空间和架构声明
- 在 XAML 和代码隐藏中声明控件
- 设置
Progress属性 - 通过 SfSkinManager 集成主题
状态
📄 阅读: references/states.md
- 确定状态(默认),使用
ShowProgressValue - 不确定状态(
IsIndeterminate="True"),用于进度未知的情况 - 缓冲状态(
SecondaryProgress、SecondaryProgressColor) - 选择适用状态的指南
外观与自定义
📄 阅读: references/appearance.md
- 通过
StartAngle/EndAngle设置弧形 - 半径和厚度:
IndicatorOuterRadius、IndicatorInnerRadius、TrackOuterRadius、TrackInnerRadius - 纯色:
ProgressColor、TrackColor - 基于范围的颜色:
RangeColor,包含Start、End、Color - 渐变效果:
RangeColor.IsGradient - 圆角端点:
IndicatorCornerRadius - 动画:
AnimationDuration、AnimationEasing
片段与自定义内容
📄 阅读: references/segments-and-custom-content.md
- 使用
SegmentCount将环拆分为离散步骤 - 使用
ProgressContent设置中心 UI(文本、按钮、图像) - 将中心文本绑定到
Progress值 - 使用
DispatcherTimer模式实现播放/暂停按钮
关键属性
| 属性 | 类型 | 默认值 | 用途 |
|---|---|---|---|
Progress | double | 0 | 当前进度值(0–100) |
ShowProgressValue | bool | false | 在中心显示数值百分比 |
IsIndeterminate | bool | false | 不确定进度的旋转动画 |
SecondaryProgress | double | 0 | 缓冲/次要进度值 |
StartAngle | double | -90 | 弧形起始角度(度) |
EndAngle | double | 270 | 弧形结束角度(度) |
SegmentCount | int | 0 | 片段数量(0 = 无) |
ProgressColor | Brush | theme | 进度弧形的颜色 |
TrackColor | Brush | theme | 轨道弧形的颜色 |
IndicatorCornerRadius | double | 0 | 进度弧形的圆角端点 |
AnimationDuration | TimeSpan | 3000ms | 不确定进度动画的循环时间 |
ProgressContent | object | null | 自定义中心内容 |
常见用例
- 文件上传指示器 — 确定进度,使用
ShowProgressValue="True" - 加载旋转指示器 — 不确定进度(
IsIndeterminate="True") - 媒体播放器 — 使用
ProgressContent放置播放/暂停按钮 - 步骤跟踪器 — 设置与总步骤数相匹配的
SegmentCount - CPU/内存仪表 — 使用
RangeColors映射绿色/黄色/红色区域 - 半圆仪表 —
StartAngle="180"EndAngle="360"
评论
支持 Markdown