HighlightTextBlock的HighlightBrush不能响应DataTrigger
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start at the HighlightTextBlock control and reproduce the provided .NET 6/WPF XAML example, comparing the working Foreground DataTrigger with the HighlightBrush and HighlightTextBrush setters. Trace how these properties are declared and applied, then verify that a DataTrigger changes the highlight brushes instead of retaining the explicitly set values.
Written by the indexing model from the issue text.
Description
Describe the bug
使用HighlightTextBlock时发现,即使设置了DataTrigger,HighlightBrush和HighlightTextBrush两个属性依然会使用默认值。
Steps to reproduce the bug
<hc:HighlightTextBlock SourceText="{Binding Header}" QueriesText="{Binding SearchText}" IsEnabled="False"
HighlightBrush="{DynamicResource DarkPrimaryBrush}" HighlightTextBrush="{DynamicResource TextIconBrush}">
<hc:HighlightTextBlock.Style>
<Style TargetType="hc:HighlightTextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="False">
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
<Setter Property="HighlightBrush" Value="{DynamicResource Gray5Brush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</hc:HighlightTextBlock.Style>
</hc:HighlightTextBlock>
上面的例子中,IsEnabled==False时,DataTrigger设置的Foreground生效(使用了SecondaryTextBrush),但HighlightBrush没有变化(依然使用DarkPrimaryBrush)
Expected behavior
No response
Screenshots
No response
NuGet package version
HandyControl 3.5.1
IDE
Visual Studio 2022
Framework type
.Net 6.0
Windows version
No response
Additional context
No response
- Dominant language
- C#
- Stars
- 7.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from HandyOrg/HandyControl
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
HandyOrg/HandyControl#1818 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
HandyOrg/HandyControl#1809 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
HandyOrg/HandyControl#1820 ·
-
不能够独立的引入用户认为需要的部分Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HandyOrg/HandyControl#1816 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
HandyOrg/HandyControl#1813 ·
All issues in HandyOrg/HandyControl
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
:watch: Not Triaged aspnet-core/svc fundamentals/subsvc Source - Docs.ms
Difficulty 1/5 Under an hour Newbie friendliness 85/100
dotnet/AspNetCore.Docs#37785 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Azure/azure-sdk-tools#17204 ·
Maintainers usually reply within 1 day
-
Проблема с Dotnet RUOpenarea-tutorials needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dotnet/website-feedback#1779 ·
-
[Bug] SwipeControl in Execute mode with more than one item replaces the whole UI with an error panelPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
microsoft/microsoft-ui-reactor#1344 ·
Maintainers usually reply within 1 day