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

StaticResource Converter doesnt work inside DataTemplate #17973

Open
DevDrake opened this issue Jan 14, 2025 · 1 comment
Open

StaticResource Converter doesnt work inside DataTemplate #17973

DevDrake opened this issue Jan 14, 2025 · 1 comment

Comments

@DevDrake
Copy link

Describe the bug

Hi, I am having the same issue that was already fixed few years ago.
#1464 (#1464)
I simply created a window resources DataTemplatethat uses custom converter to convert enum to utilize as simple combobox enum picker.
Exactly the same code works when not in DataTemplateon the same view.

To Reproduce

simply use below in datatemplate. Standard pattern for conversing enum into choice picker.

<ComboBox ItemsSource="{Binding Path=MyEnumProperty, Converter={StaticResource EnumConverter}, Mode=OneTime}" DisplayMemberBinding="{Binding Description}" SelectedValueBinding="{Binding Value}" SelectedValue="{Binding Path=MyEnumProperty, Mode=TwoWay}"/>

Expected behavior

No response

Avalonia version

11.0.0

OS

Windows

Additional context

No response

@DevDrake DevDrake added the bug label Jan 14, 2025
@timunie
Copy link
Contributor

timunie commented Jan 14, 2025

Unlikely you have the same issue...

Please provide a minimum sample to reproduce.

Sidenote: why is the binding onetime explicitly? Oneway (default) should be enough, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants