Token导航 LogoToken导航TokenDH.com
待分类操作浏览器github未标认证来源可访问许可证需确认审计通过

syncfusion-winui-treeviewSynfusion Winui 树视图

Agent Skill

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

总安装

588

周安装

25

GitHub Stars

公开资料未说明

下载量

206
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:syncfusion-winui-treeview(Synfusion Winui 树视图)
来源仓库:https://github.com/syncfusion/winui-ui-components-skills
仓库路径:skills/syncfusion-winui-treeview
安装命令:
npx skills add https://github.com/syncfusion/winui-ui-components-skills --skill syncfusion-winui-treeview
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/syncfusion/winui-ui-components-skills --skill syncfusion-winui-treeview

简介

Synfusion WinUI 树视图控件,用于层级导航与目录结构展示。

  • 适用于文件管理或配置树等界面场景。syncfusion-winui-treeview 属于待分类类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 仓库安装,兼容主流 AI 编程宿主。
  • 使用前应检查是否支持拖拽操作或节点过滤功能。
  • 建议核对原始 SKILL.md 了解虚拟化渲染与内存管理说明。

SKILL.md

Implementing WinUI TreeView

Comprehensive guide for implementing the Syncfusion® WinUI TreeView (SfTreeView) control to display hierarchical data in Windows App SDK applications.

When to Use This Skill

Use this skill when you need to:

  • Display hierarchical data in a tree structure (files, folders, categories)
  • Implement file explorers or folder browsers in WinUI applications
  • Create organization charts or reporting structures
  • Build category navigation with expandable/collapsible nodes
  • Enable node selection with single or multiple selection modes
  • Support inline editing of tree nodes
  • Implement drag-and-drop for node reordering or moving
  • Load data on demand for large hierarchies
  • Customize tree appearance with templates and styling
  • Handle CRUD operations on hierarchical data

The TreeView control excels at visualizing parent-child relationships and nested data structures.

Component Overview

The SfTreeView is a data-oriented control that displays data in a hierarchical structure with expanding and collapsing nodes. It's commonly used to illustrate folder structures, organizational hierarchies, or nested relationships.

Key Capabilities

  • Dual Data Modes: Bound mode (data binding) and Unbound mode (manual nodes)
  • Flexible Selection: Multiple selection modes including Extended with keyboard modifiers
  • Inline Editing: Edit node content with custom templates
  • Drag-and-Drop: Reorder or move nodes within the tree
  • Load on Demand: Lazy load child nodes when parent expands
  • Checkboxes: Built-in checkbox support for multi-selection
  • Context Menus: Add flyout menus for node operations
  • Animations: Smooth expand/collapse animations
  • MVVM Support: Full command and data binding support
  • Customization: Complete control over appearance with templates

When to Choose TreeView

Choose TreeView when you need:

  • Hierarchical visualization of parent-child data
  • Expandable/collapsible sections for space-efficient display
  • Multiple levels of nesting (2+ levels deep)
  • Tree navigation patterns familiar to users

Consider alternatives for:

  • Flat lists → Use ListView or DataGrid
  • Simple grouped data → Use ListView with grouping
  • Network/graph relationships → Use custom visualization

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

Start here for initial setup and your first TreeView:

  • Installing NuGet package (Syncfusion.TreeView.WinUI)
  • Adding TreeView to XAML pages
  • Basic TreeView implementation with unbound nodes
  • Simple bound mode example with hierarchical data
  • Namespace imports and control initialization
  • Project configuration

Data Management

📄 Read: references/data-binding.md

Learn how to bind TreeView to your data models:

  • Bound vs Unbound modes comparison
  • Hierarchical data source binding with ItemsSource
  • ChildPropertyName for self-relational binding
  • HierarchyPropertyDescriptors for complex hierarchies
  • ItemTemplate and ExpanderTemplate configuration
  • ObservableCollection and INotifyPropertyChanged
  • NodePopulationMode (OnDemand vs Instant)
  • NotificationSubscriptionMode for change tracking

📄 Read: references/drag-drop-crud.md

Master node manipulation and CRUD operations:

  • Enabling drag-and-drop (AllowDragging, AllowDrop)
  • Drag-drop events and customization
  • Adding nodes programmatically
  • Deleting nodes from hierarchy
  • Updating node content
  • Load on demand implementation
  • Context menu operations

User Interaction Features

📄 Read: references/selection.md

Implement node selection functionality:

  • SelectionMode options (None, Single, SingleDeselect, Multiple, Extended)
  • UI selection with mouse and touch
  • Programmatic selection (SelectedItem, SelectedItems)
  • Selection events (SelectionChanging, SelectionChanged)
  • Keyboard navigation for selection
  • Multi-selection with Ctrl/Shift modifiers
  • Selection customization and styling

📄 Read: references/expand-collapse.md

Control node expansion and collapse:

  • AutoExpandMode options
  • Programmatic expand and collapse
  • ExpandAction configuration (single/double tap)
  • IsExpanded property usage
  • Expand/collapse events
  • Expand all and collapse all scenarios
  • Maintaining expansion state

📄 Read: references/editing.md

Enable inline editing of tree nodes:

  • Enabling editing with AllowEditing
  • EditTemplate and EditTemplateSelector
  • Initiating edit mode (F2 key)
  • Committing and canceling edits
  • Edit events (ItemBeginEdit, ItemEndEdit)
  • Validation during editing
  • Bound vs unbound mode editing differences

📄 Read: references/interactivity.md

Add interactive features to your TreeView:

  • Checkbox support and configuration
  • Context flyout menus
  • Interactive events (ItemTapped, ItemDoubleTapped, ItemHolding)
  • Keyboard shortcuts and navigation
  • Touch gestures
  • Scrolling behavior
  • Animation settings (IsAnimationEnabled)

Advanced Features

📄 Read: references/mvvm-patterns.md

Implement MVVM architecture with TreeView:

  • MVVM patterns for hierarchical data
  • Commands in TreeView
  • Data binding best practices
  • ViewModel design for tree structures
  • Handling ObservableCollections
  • Event to command conversions
  • Unit testing TreeView ViewModels

Customization

📄 Read: references/appearance-customization.md

Customize the visual appearance:

  • ItemTemplate for node content
  • ExpanderTemplate for expand/collapse icons
  • Item height customization (ItemHeight, QueryNodeSize)
  • TreeLines configuration
  • Indentation and spacing
  • Adding icons and images
  • Styling selected/hover states
  • Theme integration

Quick Start Example

Here's a minimal TreeView showing a file structure:

XAML:

<Page xmlns:treeView="using:Syncfusion.UI.Xaml.TreeView">

    <Page.DataContext>
        <local:FileViewModel />
    </Page.DataContext>

    <treeView:SfTreeView x:Name="treeView"
                          Width="400"
                          Height="500"
                          ChildPropertyName="SubFiles"
                          ItemsSource="{Binding Files}">
        <treeView:SfTreeView.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="📁" Margin="0,0,5,0" />
                    <TextBlock Text="{Binding FileName}"
                               VerticalAlignment="Center" />
                </StackPanel>
            </DataTemplate>
        </treeView:SfTreeView.ItemTemplate>
    </treeView:SfTreeView>

</Page>

ViewModel (C#):

public class FileViewModel : INotifyPropertyChanged
{
    public ObservableCollection<FileNode> Files { get; set; }

    public FileViewModel()
    {
        Files = new ObservableCollection<FileNode>
        {
            new FileNode
            {
                FileName = "Documents",
                SubFiles = new ObservableCollection<FileNode>
                {
                    new FileNode { FileName = "Resume.docx" },
                    new FileNode { FileName = "CoverLetter.pdf" }
                }
            },
            new FileNode
            {
                FileName = "Downloads",
                SubFiles = new ObservableCollection<FileNode>()
            }
        };
    }

    public event PropertyChangedEventHandler PropertyChanged;
}

public class FileNode : INotifyPropertyChanged
{
    private string _fileName;
    private ObservableCollection<FileNode> _subFiles;

    public string FileName
    {
        get => _fileName;
        set { _fileName = value; OnPropertyChanged(); }
    }

    public ObservableCollection<FileNode> SubFiles
    {
        get => _subFiles;
        set { _subFiles = value; OnPropertyChanged(); }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged([CallerMemberName] string name = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
    }
}

Common Patterns

Pattern 1: File Explorer with Icons

<treeView:SfTreeView ItemsSource="{Binding Items}"
                      ChildPropertyName="Children">
    <treeView:SfTreeView.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <FontIcon Glyph="{Binding Icon}"
                          FontSize="16"
                          Margin="0,0,8,0" />
                <TextBlock Text="{Binding Name}" />
            </StackPanel>
        </DataTemplate>
    </treeView:SfTreeView.ItemTemplate>
</treeView:SfTreeView>

Pattern 2: Multiple Selection with Checkboxes

<treeView:SfTreeView SelectionMode="Multiple"
                      CheckBoxMode="Recursive">
    <!-- When parent checked, all children auto-check -->
</treeView:SfTreeView>

Pattern 3: Load on Demand

<treeView:SfTreeView LoadOnDemand="True"
                      LoadOnDemandCommand="{Binding LoadChildrenCommand}">
    <!-- Children load only when node expands -->
</treeView:SfTreeView>

Pattern 4: Programmatic Selection

// Single selection
treeView.SelectedItem = viewModel.RootNode.Children[0];

// Multiple selection
treeView.SelectedItems.Add(node1);
treeView.SelectedItems.Add(node2);

// Select all nodes
treeView.SelectAll();

Pattern 5: Context Menu Operations

<treeView:SfTreeView ItemHolding="OnItemHolding">
    <!-- Show context menu on right-click/long-press -->
</treeView:SfTreeView>
private void OnItemHolding(object sender, ItemHoldingEventArgs e)
{
    var flyout = new MenuFlyout();
    flyout.Items.Add(new MenuFlyoutItem { Text = "Rename" });
    flyout.Items.Add(new MenuFlyoutItem { Text = "Delete" });
    flyout.ShowAt(e.Element);
}

Key Properties and Methods

Essential Properties

PropertyTypeDescription
ItemsSourceobjectHierarchical data collection to bind
ChildPropertyNamestringProperty name containing child items
SelectionModeSelectionModeSelection behavior (None, Single, Multiple, Extended)
SelectedItemobjectCurrently selected item
SelectedItemsObservableCollectionCollection of selected items
AllowEditingboolEnable inline editing
AllowDraggingboolEnable drag-and-drop
AutoExpandModeAutoExpandModeAuto-expand behavior (None, AllNodes, RootNodes)
IsAnimationEnabledboolEnable expand/collapse animations
CheckBoxModeCheckBoxModeCheckbox behavior (None, Recursive)
LoadOnDemandboolEnable lazy loading of child nodes

Key Methods

MethodDescription
ExpandAll()Expands all nodes in the tree
CollapseAll()Collapses all nodes
ExpandNode(TreeViewNode)Expands specific node
CollapseNode(TreeViewNode)Collapses specific node
SelectAll()Selects all nodes
ClearSelection()Clears all selections
BringIntoView(TreeViewNode)Scrolls to make node visible

Important Events

EventDescription
SelectionChangedFired when selection changes
ItemTappedFired when node is tapped
ItemDoubleTappedFired when node is double-tapped
NodeExpandingFired before node expands
NodeExpandedFired after node expands
NodeCollapsingFired before node collapses
NodeCollapsedFired after node collapses
ItemBeginEditFired when editing starts
ItemEndEditFired when editing ends

Common Use Cases

Use Case 1: File System Browser

Display computer folders and files with expand/collapse, file icons, and context menu operations (rename, delete, copy).

When to use: Document management, file pickers, asset browsers

Key features needed:

  • Bound mode with hierarchical data
  • Custom ItemTemplate with icons
  • Context flyout menus
  • Drag-and-drop for moving files

Use Case 2: Organization Chart

Show company hierarchy with departments, teams, and employees with selection to view details.

When to use: HR applications, org visualization, reporting structures

Key features needed:

  • Bound mode with employee data
  • AutoExpandMode for initial display
  • Single selection mode
  • Custom templates for employee cards

Use Case 3: Product Category Browser

E-commerce category navigation with expandable categories and subcategories.

When to use: E-commerce, content management, product catalogs

Key features needed:

  • Load on demand for large catalogs
  • Single selection
  • Custom styling for categories
  • Click events for navigation

Use Case 4: Settings Panel

Hierarchical settings interface with grouped options and expandable sections.

When to use: Application settings, preferences UI, configuration panels

Key features needed:

  • Unbound mode with manual nodes
  • AutoExpandMode for convenience
  • Custom ItemTemplate for settings controls
  • Maintain expansion state

Use Case 5: Project Explorer (IDE-like)

Display solution structure with projects, folders, and files similar to Visual Studio.

When to use: Developer tools, IDEs, code editors

Key features needed:

  • Bound mode with solution model
  • Inline editing for renaming
  • Drag-drop for reorganizing
  • Context menus for file operations
  • Multiple selection for batch operations

Performance Tips

  • Use OnDemand NodePopulationMode for large hierarchies (1000+ nodes)
  • Set NotificationSubscriptionMode to CollectionChanged only if needed
  • Use x:Bind instead of Binding for better performance
  • Minimize complexity in ItemTemplate
  • Use LoadOnDemand for deep hierarchies with many children
  • Consider virtualization for very large flat sections

Troubleshooting Quick Reference

IssueSolution
Nodes not expandingCheck ChildPropertyName matches property name exactly
Selection not workingSet SelectionMode to Single or Multiple
Data not updatingImplement INotifyPropertyChanged on data models
Children not loadingSet NotificationSubscriptionMode to CollectionChanged
Poor performanceEnable OnDemand mode and LoadOnDemand
Editing not enabledSet AllowEditing="True" and define EditTemplate
Drag-drop not workingSet both AllowDragging and AllowDrop to true

Related Components

  • ListView - For flat lists without hierarchy
  • DataGrid - For tabular data with hierarchy support (TreeGrid)
  • Expander - For simple expand/collapse sections

Next Steps: Read the reference documentation linked above based on your specific needs. Start with getting-started.md if you're new to TreeView.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.06%
按下载量换算70

Claude

32.36%
按下载量换算67

Cursor

19.67%
按下载量换算41

Gemini CLI

9.88%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills