syncfusion-wpf-linear-progressbar
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing SfLinearProgressBar (WPF)
实现SfLinearProgressBar(WPF)
When to Use This Skill
适用场景
Use this skill when:
- Displaying a horizontal progress bar for a known task (determinate)
- Showing an indeterminate bouncing animation while progress is unknown
- Visualizing primary + secondary (buffer) progress simultaneously
- Splitting progress into discrete segments
- Customizing colors, gradients, padding, or corner radius
- Applying range-based colors across progress value zones
Assembly:
Namespace:
XAML Schema:
Key Class:
Syncfusion.SfProgressBar.WPFSyncfusion.UI.Xaml.ProgressBarhttp://schemas.syncfusion.com/wpfSfLinearProgressBar使用该组件的场景:
- 为已知任务显示水平进度条(确定型)
- 进度未知时显示不确定型弹跳动画
- 同时可视化主进度与次要(缓冲)进度
- 将进度拆分为独立分段
- 自定义颜色、渐变、内边距或圆角半径
- 为不同进度值区间应用分段颜色
程序集:
命名空间:
XAML 架构:
核心类:
Syncfusion.SfProgressBar.WPFSyncfusion.UI.Xaml.ProgressBarhttp://schemas.syncfusion.com/wpfSfLinearProgressBarQuick Start
快速入门
xaml
<Window xmlns:Syncfusion="http://schemas.syncfusion.com/wpf">
<Grid x:Name="grid">
<Syncfusion:SfLinearProgressBar
Progress="70"
Width="500"
Height="20" />
</Grid>
</Window>csharp
using Syncfusion.UI.Xaml.ProgressBar;
SfLinearProgressBar linear = new SfLinearProgressBar();
linear.Progress = 70;
linear.Width = 500;
linear.Height = 20;
grid.Children.Add(linear);xaml
<Window xmlns:Syncfusion="http://schemas.syncfusion.com/wpf">
<Grid x:Name="grid">
<Syncfusion:SfLinearProgressBar
Progress="70"
Width="500"
Height="20" />
</Grid>
</Window>csharp
using Syncfusion.UI.Xaml.ProgressBar;
SfLinearProgressBar linear = new SfLinearProgressBar();
linear.Progress = 70;
linear.Width = 500;
linear.Height = 20;
grid.Children.Add(linear);Documentation and Navigation Guide
文档与导航指南
Getting Started
入门指南
📄 Read: references/getting-started.md
- NuGet/assembly installation ()
Syncfusion.SfProgressBar.WPF - XAML namespace and schema declaration
- Declaring in XAML and code-behind
- Setting the property
Progress - Theme integration via SfSkinManager
📄 阅读: references/getting-started.md
- NuGet/程序集安装()
Syncfusion.SfProgressBar.WPF - XAML命名空间与架构声明
- 在XAML与代码后置中声明组件
- 设置属性
Progress - 通过SfSkinManager集成主题
States
状态说明
📄 Read: references/states.md
- Determinate state (default) for known progress
- Indeterminate state () for unknown duration
IsIndeterminate="True" - Buffer state (,
SecondaryProgress)SecondaryProgressColor - Decision guide: which state to use when
- Switching states dynamically via MVVM binding
📄 阅读: references/states.md
- 确定型状态(默认):适用于已知进度的场景
- 不确定型状态():适用于时长未知的场景
IsIndeterminate="True" - 缓冲状态(、
SecondaryProgress)SecondaryProgressColor - 选择指南:不同场景下的状态选择
- 通过MVVM绑定动态切换状态
Appearance & Segments
外观与分段
📄 Read: references/appearance-and-segments.md
- — rounded ends
IndicatorCornerRadius - — gap between track and progress bar
IndicatorPadding - /
ProgressColor— solid color customizationTrackColor - :
RangeColorswithRangeColor,Start,EndColor - Gradient:
RangeColor.IsGradient - /
AnimationDuration(indeterminate only)AnimationEasing - — split bar into sections
SegmentCount - Segments with corner radius
📄 阅读: references/appearance-and-segments.md
- — 进度条两端圆角
IndicatorCornerRadius - — 轨道与进度条之间的间隙
IndicatorPadding - /
ProgressColor— 纯色自定义TrackColor - :包含
RangeColors、Start、End属性的Color集合RangeColor - 渐变:通过开启
RangeColor.IsGradient - /
AnimationDuration(仅适用于不确定型状态)AnimationEasing - — 将进度条拆分为多个分段
SegmentCount - 带圆角的分段
Key Properties
核心属性
| Property | Type | Default | Purpose |
|---|---|---|---|
| | | Current progress value (0–100) |
| | | Indeterminate bouncing animation |
| | | Buffer/secondary progress value |
| | theme | Color of the buffer bar |
| | theme | Color of the progress bar |
| | theme | Color of the background track |
| | | Rounded ends on progress bar |
| | | Gap between track and indicator |
| | | Number of segments (0 = none) |
| | | Indeterminate animation cycle time |
| 属性 | 类型 | 默认值 | 用途 |
|---|---|---|---|
| | | 当前进度值(0-100) |
| | | 启用不确定型弹跳动画 |
| | | 缓冲/次要进度值 |
| | 主题默认 | 缓冲条颜色 |
| | 主题默认 | 进度条颜色 |
| | 主题默认 | 背景轨道颜色 |
| | | 进度条两端圆角半径 |
| | | 轨道与进度指示器之间的间隙 |
| | | 分段数量(0表示无分段) |
| | | 不确定型动画周期时长 |
Common Use Cases
常见使用场景
- File download bar — determinate with bound to download percentage
Progress - Loading animation — indeterminate ()
IsIndeterminate="True" - Video buffering — ahead of
SecondaryProgressProgress - Step tracker — matching total steps
SegmentCount - Health/battery bar — mapping green/yellow/red zones
RangeColors - Styled progress pill — for rounded bar
IndicatorCornerRadius="10"
- 文件下载进度条 — 确定型,绑定下载百分比
Progress - 加载动画 — 不确定型()
IsIndeterminate="True" - 视频缓冲 — 值领先于
SecondaryProgressProgress - 步骤追踪器 — 与总步骤数匹配
SegmentCount - 健康/电池进度条 — 映射绿/黄/红区间
RangeColors - 样式化胶囊进度条 — 设置实现圆角进度条
IndicatorCornerRadius="10"