Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ColorPicker Binding failed #579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Poker-sang
Copy link
Contributor

GridView.SelectedValue to null is transient behavior. It does not affect the original ColorPicker behavior.

Fixes

closes: #414

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

image

image

What is the new behavior?

image

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • New component
    • Documentation has been added
    • Sample in sample app has been added
    • Analyzers are passing for documentation and samples
    • Icon has been created (if new sample) following the Thumbnail Style Guide and templates
  • Tests for the changes have been added (if applicable)
  • Header has been added to all new source files
  • Contains NO breaking changes

Other information

@@ -291,7 +292,7 @@
animations:Implicit.HideAnimations="{StaticResource HideTransitions}"
animations:Implicit.ShowAnimations="{StaticResource ShowTransitions}"
ItemsSource="{TemplateBinding CustomPaletteColors}"
SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Mode=TwoWay}"
SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Converter={StaticResource NullToTransparentConverter}, Mode=TwoWay}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is TargetNullValue not sufficient here for some reason?

Copy link
Contributor Author

@Poker-sang Poker-sang Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the null problem arises with BindBack and not Bind, I guess TargetNullValue won't help.

@michael-hawker michael-hawker added this to the 8.2 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

XAML Binding failed in ColorPicker
3 participants