microsoft / microsoft/microsoft-ui-xaml
Setting a RichTextBlock's Style to a TextBlock style shows no error or warning nor the app breaks
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
In my case I had a BodyStrongTextBlockStyle in my RichTextBlock and the app worked normally when debugging. I didn't notice anything because I set the Paragraph's FontWeight in code, so the text showed up bold as I expected. I know it shouldn't work, I don't expect it to work. I didn't even notice that was there, so it took me a minute to realize what was wrong. The app doesn't break when debugging, only when opening outside Visual Studio, so it was annoying.
### Steps to reproduce the bug
Use a RichTextBlock with BodyStrongTextBlockStyle as its style.
### Expected behavior
To show an error or a warning.
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
### Windows version
_No response_
### Additional context
Build 26100
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
Reproduce the issue with a RichTextBlock using BodyStrongTextBlockStyle under WinUI 3 / Windows App SDK 1.6.1, then trace how the invalid style assignment is handled when the app is launched outside Visual Studio. Done means the mismatch produces a clear error or warning instead of failing silently.
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