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 };
}
I think that
DataTriggerBehavior
only works withint
anddouble
for numeric data. I tested withshort
,long
,float
,decimal
and it does not work as expected. I used the following code: