Can anyone tell me why the following doesn't work, but the one after it does? Notice the Value= syntax versus the explicit usage on the latter. I don't understand the difference.
<Style.Triggers>
<DataTrigger Binding="{Binding ItemType}" Value="{x:Type log:FranchiseAiring}">
<Setter Property="Template" Value="{StaticResource FranchiseRowStyle}" />
</DataTrigger>
</Style.Triggers>
Above throws an exception, below works fine:
<Style.Triggers>
<DataTrigger Binding="{Binding ItemType}">
<DataTrigger.Value>
<x:Type Type="{x:Type log:FranchiseAiring}" />
</DataTrigger.Value>
<Setter Property="Template" Value="{StaticResource FranchiseRowStyle}" />
</DataTrigger>
Exception: Must specify both Binding and Value for DataTrigger. Error at object 'System.Windows.DataTrigger' in markup file ';component/ResourceDictionaries/LogStyles.xaml' Line 14 Position 15.
Stack Trace: at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri,