You cannot bind the parameter of a converter because it is not a DependencyProperty. So this throws an error at run time (in InitializeComponent).
<TextBlock Text="{Binding DistrictID, Converter={StaticResource ID2DescriptionConverter}, ConverterParameter={Binding DistrictTable}}"/>
But you can use a StaticResource and a StaticResource can be bound.
Add this to your resources
<CollectionViewSource x:Key="DistrictTable" Source="{Binding DistrictTable}"/>
<TextBlock Text="{Binding DistrictID, Converter={StaticResource ID2DescriptionConverter}, ConverterParameter={StaticResource DistrictTable}}"/>
No comments:
Post a Comment