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

Transformation of value in DataTriggerBehavior #48

Closed
MopsiMauser opened this issue Aug 27, 2020 · 2 comments
Closed

Transformation of value in DataTriggerBehavior #48

MopsiMauser opened this issue Aug 27, 2020 · 2 comments
Labels

Comments

@MopsiMauser
Copy link

Hello everyone,

First of all I want to say thank you for this library!!! I have a question regarding DataTriggerBehavior: is it possible to use some transformation function on a binding value or have additional comparison conditions, for example in order to compare it case insensitive? example:

<StackPanel> <i:Interaction.Behaviors> <ia:DataTriggerBehavior Binding="{Binding Person.LastName}" ComparisonCondition="Equal" Value="foo"> <ia:ChangePropertyAction TargetObject="{Binding #LastName}" PropertyName="Foreground" Value="#FF0000" /> </ia:DataTriggerBehavior> </i:Interaction.Behaviors> <TextBox Name="LastName" Classes="important" Text="{Binding Person.LastName}"></TextBox> </StackPanel>

My goal is to compare Person.LastName case insensitive to foo.

@wieslawsoltes
Copy link
Contributor

I think you can use value converters on bindings to have case insensitive comparison..

@wieslawsoltes
Copy link
Contributor

http://avaloniaui.net/docs/binding/converting-binding-values

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

No branches or pull requests

2 participants