Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

syncfusion-wpf-percent-textbox同步融合 wpf 百分比文本框

Agent Skill

syncfusion-wpf-percent-textbox 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

978

周安装

42

GitHub Stars

2

下载量

343
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-wpf-percent-textbox(同步融合 wpf 百分比文本框)
来源仓库:https://github.com/syncfusion/wpf-ui-components-skills
仓库路径:skills/syncfusion-wpf-percent-textbox
安装命令:
npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-percent-textbox
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-percent-textbox

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理与分析。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 建议确认权限范围和维护状态,避免触发联网或文件读写操作。
  • syncfusion-wpf-percent-textbox 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Implementing Syncfusion WPF PercentTextBox

When to Use This Skill

Use this skill when the user needs to:

  • Implement percentage input controls in WPF applications with value restrictions and formatting
  • Configure value validation with minimum/maximum limits and validation timing (OnKeyPress vs OnLostFocus)
  • Apply number formatting with culture-specific separators, decimal digits, and group sizes
  • Customize appearance with different foreground colors for positive, negative, and zero values
  • Enable interactive features like scroll intervals, mouse wheel support, click-and-drag value changes
  • Display visual progress using range adorner to show value relative to min/max range
  • Bind percentage data from ViewModels with property change notifications
  • Handle null values with custom null displays or watermark text
  • Implement international formats with culture-based decimal/group separators and percent symbols

The PercentTextBox control restricts input to double values and displays them as percentages with extensive customization options for data binding, validation, formatting, and appearance.

Component Overview

The Syncfusion WPF PercentTextBox is a specialized input control that:

  • Restricts input to double values only (no text allowed)
  • Displays values as percentages with customizable symbols and patterns
  • Supports min/max value validation with configurable validation timing
  • Provides data binding support for MVVM patterns
  • Offers culture-specific formatting with group separators and decimal digits
  • Allows different foreground colors for positive, negative, and zero values
  • Supports interactive value changes via keyboard arrows, mouse wheel, and click-drag
  • Includes range adorner for visual progress indication
  • Handles null values with watermark text support
  • Provides built-in visual styles and themes

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

Use this reference when you need to:

  • Add PercentTextBox to a WPF project (via designer, XAML, or C#)
  • Configure assembly deployment and NuGet packages (Syncfusion.Shared.WPF)
  • Understand basic PercentValue property usage
  • Set up initial control dimensions and placement
  • Learn the basic control declaration patterns

Value Management and Binding

📄 Read: references/value-management.md

Use this reference when you need to:

  • Set and change percentage values using PercentValue property
  • Implement data binding (unidirectional or bidirectional) with ViewModels
  • Handle PercentValueChanged events to track value changes
  • Configure null value behavior with NullValue and UseNullOption properties
  • Display watermark text when control is empty or null
  • Customize watermark appearance with foreground colors or templates
  • Control paste behavior with PasteMode property (Default vs Advanced)
  • Add spin buttons for increment/decrement operations

Validation and Restrictions

📄 Read: references/validation-and-restrictions.md

Use this reference when you need to:

  • Restrict values within minimum and maximum limits (MinValue, MaxValue)
  • Configure validation timing (MinValidation, MaxValidation: OnKeyPress vs OnLostFocus)
  • Control behavior when exceeding limits (MaxValueOnExceedMaxDigit, MinValueOnExceedMinDigit)
  • Restrict decimal digit count with MinPercentDecimalDigits and MaxPercentDecimalDigits
  • Understand property precedence for decimal digit settings
  • Enable read-only mode while allowing text selection and caret visibility
  • Prevent invalid input at key press vs validating on focus lost

Number Formatting and Culture

📄 Read: references/number-formatting.md

Use this reference when you need to:

  • Apply culture-specific formatting with Culture property
  • Configure NumberFormatInfo for custom number patterns
  • Set group separators (PercentGroupSeparator) and group sizes (PercentGroupSizes)
  • Customize decimal separators and digit counts
  • Change percentage symbol (PercentageSymbol)
  • Enable group separator display with GroupSeperatorEnabled
  • Define positive value patterns (PercentPositivePattern: 4 options)
  • Define negative value patterns (PercentNegativePattern: 12 options)
  • Understand property precedence (dedicated properties vs NumberFormat vs Culture)

Appearance Customization

📄 Read: references/appearance-customization.md

Use this reference when you need to:

  • Set different foreground colors for positive values (PositiveForeground)
  • Apply negative foreground with ApplyNegativeForeground and NegativeForeground
  • Display zero values with custom color (ApplyZeroColor, ZeroColor)
  • Customize background brush for the control
  • Apply corner radius for rounded borders
  • Configure selection brush and opacity for highlighted text
  • Align text (Left, Center, Right) using TextAlignment
  • Add tooltips with custom information

Interactive Features

📄 Read: references/interactive-features.md

Best Practices

📄 Read: references/best-practices.md

Use this reference when you need to:

  • Configure scroll interval for value increments/decrements
  • Enable keyboard navigation with Up/Down arrow keys
  • Allow mouse wheel scrolling with IsScrollingOnCircle
  • Enable click-and-drag value changes with EnableExtendedScrolling
  • Control text selection behavior on focus (TextSelectionOnFocus)
  • Display spin buttons for manual increment/decrement
  • Enable range adorner for visual progress indication (EnableRangeAdorner)
  • Customize range adorner background color
  • Understand min/max requirements for range adorner display

Quick Start Example

Basic PercentTextBox in XAML

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
    x:Class="PercentTextBoxSample.MainWindow">
    <Grid>
        <syncfusion:PercentTextBox x:Name="percentTextBox"
                                   Width="150"
                                   Height="30"
                                   PercentValue="75.5"
                                   MinValue="0"
                                   MaxValue="100"/>
    </Grid>
</Window>

Basic PercentTextBox in C#

using Syncfusion.Windows.Shared;

// Create instance
PercentTextBox percentTextBox = new PercentTextBox();
percentTextBox.Width = 150;
percentTextBox.Height = 30;

// Set value and limits
percentTextBox.PercentValue = 75.5;
percentTextBox.MinValue = 0;
percentTextBox.MaxValue = 100;

// Add to container
this.Content = percentTextBox;

Data Binding Example

<!-- XAML -->
<syncfusion:PercentTextBox PercentValue="{Binding DiscountPercentage, UpdateSourceTrigger=PropertyChanged}"
                           Width="150" Height="30"
                           MinValue="0" MaxValue="100"/>
// ViewModel.cs
public class ViewModel : INotifyPropertyChanged
{
    private double discountPercentage;
    public double DiscountPercentage
    {
        get { return discountPercentage; }
        set
        {
            discountPercentage = value;
            OnPropertyChanged(nameof(DiscountPercentage));
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged(string propertyName)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

Common Patterns

Pattern 1: Percentage Input with Validation

When user needs a percentage input with immediate validation on keypress:

<syncfusion:PercentTextBox PercentValue="50"
                           MinValue="0"
                           MaxValue="100"
                           MinValidation="OnKeyPress"
                           MaxValidation="OnKeyPress"
                           MaxValueOnExceedMaxDigit="True"
                           MinValueOnExceedMinDigit="True"/>

Why this works: OnKeyPress validation prevents invalid input immediately, and the exceed properties reset to limits when boundaries are crossed.

Pattern 2: Formatted Percentage with Culture

When user needs culture-specific percentage formatting:

<syncfusion:PercentTextBox PercentValue="1234.567"
                           Culture="de-DE"
                           GroupSeperatorEnabled="True"
                           PercentDecimalDigits="2"/>

Why this works: German culture uses "." for group separator and "," for decimal separator, automatically formatting the display.

Pattern 3: Color-Coded Percentage Values

When user needs visual differentiation for positive/negative/zero values:

<syncfusion:PercentTextBox PercentValue="-15"
                           PositiveForeground="Green"
                           NegativeForeground="Red"
                           ApplyNegativeForeground="True"
                           ZeroColor="Gray"
                           ApplyZeroColor="True"/>

Why this works: Different colors help users quickly identify value states without reading the number.

Pattern 4: Interactive Percentage with Scroll

When user needs quick value adjustments via keyboard/mouse:

<syncfusion:PercentTextBox PercentValue="25"
                           ScrollInterval="5"
                           IsScrollingOnCircle="True"
                           EnableExtendedScrolling="True"
                           ShowSpinButton="True"/>

Why this works: Multiple interaction methods (arrow keys, mouse wheel, spin buttons, click-drag) provide flexibility for user preference.

Pattern 5: Range Adorner for Visual Feedback

When user needs visual progress indication:

<syncfusion:PercentTextBox PercentValue="65"
                           MinValue="0"
                           MaxValue="100"
                           EnableRangeAdorner="True"
                           RangeAdornerBackground="LightBlue"/>

Why this works: Range adorner fills the control background proportionally, showing progress at a glance like a progress bar.

Pattern 6: Null Value with Watermark

When user needs placeholder text for empty state:

<syncfusion:PercentTextBox UseNullOption="True"
                           NullValue="{x:Null}"
                           WatermarkText="Enter discount %"
                           WatermarkTextIsVisible="True"
                           WatermarkTextForeground="Gray"/>

Why this works: Watermark provides user guidance when control is empty, improving UX.

Key Properties Reference

Value Properties

  • PercentValue - Gets or sets the percentage value (double)
  • MinValue - Minimum allowed value
  • MaxValue - Maximum allowed value
  • NullValue - Value to display when UseNullOption is true and value is null
  • UseNullOption - Enables null value handling

Validation Properties

  • MinValidation - Validation timing for minimum (OnKeyPress, OnLostFocus)
  • MaxValidation - Validation timing for maximum (OnKeyPress, OnLostFocus)
  • MinValueOnExceedMinDigit - Reset to MinValue when exceeded (bool)
  • MaxValueOnExceedMaxDigit - Reset to MaxValue when exceeded (bool)

Formatting Properties

  • Culture - Culture for number formatting (CultureInfo)
  • NumberFormat - Custom NumberFormatInfo object
  • PercentGroupSeparator - Character for grouping (e.g., ",")
  • PercentGroupSizes - Array of group sizes (e.g., {3, 2})
  • PercentDecimalSeparator - Decimal point character (e.g., ".")
  • PercentDecimalDigits - Number of decimal places
  • MinPercentDecimalDigits - Minimum decimal digits
  • MaxPercentDecimalDigits - Maximum decimal digits
  • PercentageSymbol - Percent symbol (default "%")
  • GroupSeperatorEnabled - Show/hide group separator (bool)
  • PercentPositivePattern - Format for positive values (0-3)
  • PercentNegativePattern - Format for negative values (0-11)

Appearance Properties

  • PositiveForeground - Foreground brush for positive values
  • NegativeForeground - Foreground brush for negative values
  • ApplyNegativeForeground - Enable negative foreground (bool)
  • ZeroColor - Foreground brush for zero value
  • ApplyZeroColor - Enable zero color (bool)
  • Background - Control background brush
  • CornerRadius - Border corner radius
  • SelectionBrush - Selected text background
  • SelectionOpacity - Selected text opacity (0-1)
  • TextAlignment - Text alignment (Left, Center, Right)

Interactive Properties

  • ScrollInterval - Increment/decrement step value
  • IsScrollingOnCircle - Enable mouse wheel scrolling (bool)
  • EnableExtendedScrolling - Enable click-drag scrolling (bool)
  • ShowSpinButton - Display up/down buttons (bool)
  • TextSelectionOnFocus - Auto-select text on focus (bool)
  • EnableRangeAdorner - Show range adorner (bool)
  • RangeAdornerBackground - Range adorner fill brush

Watermark Properties

  • WatermarkText - Placeholder text string
  • WatermarkTextIsVisible - Show watermark (bool)
  • WatermarkTextForeground - Watermark text color
  • WatermarkTemplate - Custom DataTemplate for watermark

Other Properties

  • IsReadOnly - Prevent user editing (bool)
  • IsReadOnlyCaretVisible - Show caret in read-only mode (bool)
  • PasteMode - Paste behavior (Default, Advanced)
  • ToolTip - Tooltip text or object

Common Use Cases

1. Discount/Tax Calculator

Use PercentTextBox for discount or tax percentage inputs with 0-100% range, 2 decimal places, and immediate validation.

2. Progress/Completion Tracker

Display project completion percentages with range adorner for visual feedback, restricted to 0-100%.

3. Financial Calculations

Handle interest rates, ROI percentages, or growth rates with culture-specific formatting and multiple decimal places.

4. Survey/Rating Systems

Collect percentage-based ratings with color-coded foregrounds (green for high, red for low).

5. Resource Allocation

Input percentage allocations (e.g., budget distribution) with validation ensuring total doesn't exceed 100%.

6. Configuration Settings

Set performance thresholds, cache sizes, or buffer percentages with scroll intervals for quick adjustments.

7. Data Analysis Forms

Collect statistical percentages with group separators for large numbers and culture-specific formatting.

8. Dashboard Controls

Display KPI percentages with range adorners showing progress toward targets, bound to live data.


Next Steps:

  1. Read the appropriate reference file based on your specific implementation need
  2. Use the quick start example as a foundation
  3. Apply common patterns that match your use case
  4. Refer to key properties for fine-tuning behavior and appearance

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.34%
按下载量换算128

Claude

31.83%
按下载量换算109

Cursor

19.07%
按下载量换算65

Gemini CLI

8.92%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills