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

DataTriggerBehavior does not work with all numeric types #140

Open
MatrixRonny opened this issue Nov 1, 2018 · 1 comment
Open

DataTriggerBehavior does not work with all numeric types #140

MatrixRonny opened this issue Nov 1, 2018 · 1 comment
Assignees

Comments

@MatrixRonny
Copy link

I think that DataTriggerBehavior only works with int and double for numeric data. I tested with short, long, float, decimal and it does not work as expected. I used the following code:

public class SampleViewModel
{
  decimal Number { get; set; }
}
public SampleView()
{
  this.InitializeComponent();
  Loaded += SampleView_Loaded;
}

private void SampleView_Loaded(object sender, RoutedEventArgs e)
{
  DataContext = new SampleViewModel { Number = 0 };
}
<TextBlock Text="The test" HorizontalAlignment="Center" VerticalAlignment="Center">
  <Interactivity:Interaction.Behaviors>
    <Core:DataTriggerBehavior Binding="{Binding Number}" ComparisonCondition="GreaterThan" Value="-1">
      <Core:ChangePropertyAction PropertyName="Visibility" Value="Collapsed"/>
    </Core:DataTriggerBehavior> 
  </Interactivity:Interaction.Behaviors>
</TextBlock>
@skendrot
Copy link
Collaborator

skendrot commented Nov 1, 2018

Thanks for reporting. I can confirm the issue and I'm looking into a fix

@skendrot skendrot self-assigned this Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants