Issue setting foreground color of TextBox via ChangePropertyAction
See original GitHub issueI try to set the Foreground property of a TextBox via a DataTriggerBehavior and ChangePropertyAction:
<TextBox Name="LastName" Text="{Binding Person.LastName}"> <i:Interaction.Behaviors> <ia:DataTriggerBehavior Binding="{Binding Person.LastName, Converter={StaticResource toLowerStringConverter}}" ComparisonCondition="Equal" Value="schulz"> <ia:ChangePropertyAction TargetObject="{Binding #LastName}" PropertyName="Foreground" Value="#FF0000" /> </ia:DataTriggerBehavior> </i:Interaction.Behaviors> </TextBox>
But the TextBox doesnt show the letters at all, although you can see that it has content because you can see some “spaces” inside the TextBox:
I attached an example solution. AvaloniaTest.zip
I am using the latest version 0.9.12
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
@MopsiMauser Found the issue and fixed. The fixed version will be released today as 0.10.0-preview5 and will be part of 0.10.0 later.
https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/5b49379d5371e6ff585e278a8a28fa3962baf49c/src/Avalonia.Xaml.Interactions/Core/TypeConverterHelper.cs#L19
https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/f48426ee62a705ea5a1c45d4753e6ab219eca3f8/src/Avalonia.Xaml.Interactions/Core/ChangePropertyAction.cs#L122
https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/f48426ee62a705ea5a1c45d4753e6ab219eca3f8/src/Avalonia.Xaml.Interactions/Core/ChangePropertyAction.cs#L195
https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/42ca9eb62ddae6f39e95d088316a28030589f2b6/src/Avalonia.Xaml.Interactions/Core/DataTriggerBehavior.cs#L68