Windows
Windows copied to clipboard
XAML Binding failed in ColorPicker
Describe the bug
The ColorPicker
/ColorPickerButton
has a binding failed issue (When use {x:Bind}
on ColorPicker.Color
or ColorPickerButton.SelectedColor
):
CommunityToolkit.WinUI.Controls.ColorPicker
Color
Microsoft.UI.Xaml.Controls.GridView.SelectedValue
Object
Converter failed to convert value of type 'null' to type 'Color'
This issue has been present since version 7.x.
Steps to reproduce
It's easy to reproduce this issue:
<controls:ColorPicker Color="{x:Bind ColorX}" />
Color ColorX { get; set; }
And then you can see: (see Screenshots)
Expected behavior
No Binding failure
Screenshots
Code Platform
- [ ] UWP
- [X] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK
Windows Build Number
- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 10 21H2 (Build 19044)
- [ ] Windows 10 22H2 (Build 19045)
- [ ] Windows 11 21H2 (Build 22000)
- [ ] Other (specify)
Other Windows Build number
No response
App minimum and target SDK version
- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Windows 10, version 2104 (Build 20348)
- [ ] Windows 11, version 22H2 (Build 22000)
- [ ] Other (specify)
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
I thought the bug is caused by this line:
Maybe the TemplateParent
is null or something?
Help us help you
No, I'm unable to contribute a solution.