microsoft / microsoft/microsoft-ui-xaml
TextRange not usable in XAML
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
Describe the bug
One can't use TextRange in XAML because StartIndex and Length are fields not properties. One also can't create a derived class having such properties, because it is sealed. This makes it very difficult to use TextRange in a XAML data template.
Steps to reproduce the bug
Create a ListView with a resource for the DataTemplate as shown in the screenshot. Observe that the StartIndex and Length cannot be assigned or bound.
Expected behavior
Should be able to use TextRange in XAML.
Screenshots
NuGet package version
None
Windows version
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TextRange and the ListView resource/DataTemplate reproduction described in the issue. Verify the API behavior against XAML assignment and binding for StartIndex and Length; done means TextRange is usable in XAML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100