uno-toolkit-visualstatemanager-extensions
Use VisualStateManagerExtensions to create data-driven visual states. Bind VisualState directly to view model properties.
来源信息
- 仓库
- unoplatform/studio
- 最近来源活动
- 2026年6月9日 19:39
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 10
- 分支
- 1
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- uno-toolkit-visualstatemanager-extensions
- description
- Use VisualStateManagerExtensions to create data-driven visual states. Bind VisualState directly to view model properties.
- when_to_use
- Use when visual states must be driven by view-model properties rather than `VisualStateManager.GoToState` calls from code-behind — bind the active state name (e.g. an enum) and the framework swaps states automatically.
- metadata
- {"author":"uno-platform","version":"2.4","category":"toolkit"}
# Uno Toolkit VisualStateManager Extensions — Agent Skill
## Workflow
> **Docs lookup:** call `uno_platform_docs_search(...)` first, then `uno_platform_docs_fetch(sourcePath="…")` using the `sourcePath` field from a result (a relative `.md` path; add the result's `anchor` for a section). Never pass a URL, a `.html` link, or a hand-built path.
### Step 1: Fetch the VisualStateManager Extensions Documentation
```
uno_platform_docs_search("Uno Toolkit VisualStateManager extensions data driven visual state binding")
```
Primary documentation page:
- **VisualStateManager Extensions**: `external/uno.toolkit.ui/doc/helpers/VisualStateManager-extensions.md`
Fetch the page:
```
uno_platform_docs_fetch(sourcePath="external/uno.toolkit.ui/doc/helpers/VisualStateManager-extensions.md")
```
## Key Principles (Stable)
- `utu:VisualStateManagerExtensions.States` — attached property bound to a string property (note: **States** plural)
- Supports comma, semicolon, or space separated list for multiple concurrent states from different VisualStateGroups
- When the bound property changes, the matching VisualState is activated
- Property value maps directly to VisualState name
- Eliminates need for code-behind `VisualStateManager.GoToState()` calls
- **Important**: `VisualStateManager.VisualStateGroups` must be defined on the same element that has the `States` attached property
- XAML namespace: `xmlns:utu="using:Uno.Toolkit.UI"`
## Related Skills
- [[uno-toolkit-responsive]] — Responsive layout based on screen size
在 GitHub 查看