TitleBarButton not found in xaml (Binding Error)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Hi, I followed [https://github.com/lepoco/wpfui/issues/935] this resolve. and then the first view theme became Dark mode. yea, this is what i want.
The program runs, but the minimize, maximize, and close buttons initially become a Dark foregurd rather than a theme-optimized white foreground.
And a binding error appeared as below. What's interesting is that when I mouse over those buttons, it turns white.
How should I solve this problem? Is there anything that could cause the binding error? I can't do anything about it because the buttons in the titlebar are provided by wpf-ui.
[Binding error]
-
Systehttp://m.windows.data/ Error: 40 : BindingExpression path error: 'MouseOverButtonsForeground' property not found on 'object' ''TitleBar' (Name='TitleBar')'. BindingExpression:Path=MouseOverButtonsForeground; DataItem='TitleBar' (Name='TitleBar'); target element is 'TitleBarButton' (Name='PART_HelpButton'); target property is 'MouseOverButtonsForeground' (type 'Brush')
-
Systehttp://m.windows.data/ Error: 40 : BindingExpression path error: 'MouseOverButtonsForeground' property not found on 'object' ''TitleBar' (Name='TitleBar')'. BindingExpression:Path=MouseOverButtonsForeground; DataItem='TitleBar' (Name='TitleBar'); target element is 'TitleBarButton' (Name='PART_MinimizeButton'); target property is 'MouseOverButtonsForeground' (type 'Brush')
-
Systehttp://m.windows.data/ Error: 40 : BindingExpression path error: 'MouseOverButtonsForeground' property not found on 'object' ''TitleBar' (Name='TitleBar')'. BindingExpression:Path=MouseOverButtonsForeground; DataItem='TitleBar' (Name='TitleBar'); target element is 'TitleBarButton' (Name='PART_MaximizeButton'); target property is 'MouseOverButtonsForeground' (type 'Brush')
-
Systehttp://m.windows.data/ Error: 40 : BindingExpression path error: 'MouseOverButtonsForeground' property not found on 'object' ''TitleBar' (Name='TitleBar')'. BindingExpression:Path=MouseOverButtonsForeground; DataItem='TitleBar' (Name='TitleBar'); target element is 'TitleBarButton' (Name='PART_CloseButton'); target property is 'MouseOverButtonsForeground' (type 'Brush')
To Reproduce
pass.
Expected behavior
I didn't Expect. because I tried new wpf-ui app. and this is successed. but I applied my project Im doing and then run program. the result is that Screenshots result same. It changes from dark to white only after I raise the mouse on the button (close || minimum || maximum window buttons).
Screenshots
minimum button is that after mouse over on minimum button. so foreground(brush) color is white. other is not mouse over so It's still Dark.
OS version
win 11
.NET version
.net 8.0
WPF-UI NuGet version
3.03
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 by reproducing the binding error with WPF-UI 3.0.3 on Windows 11, then inspect the TitleBar and TitleBarButton entry points named in the error. Compare the initial button foreground with the hover state and determine what causes the MouseOverButtonsForeground binding failure; done means the error is resolved and the buttons use the expected theme foreground before hover.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100