【发布时间】:2012-09-10 16:31:12
【问题描述】:
我以这种方式在我的 XAML 中为TextBlock 的Text 属性设置了绑定:
<TextBlock x:Name="MyTextBlock" TextWrapping="Wrap" Text="{Binding TextProperty, Converter={StaticResource MyConverter}}"/>
我想从当前使用的代码隐藏中更改转换器。如何从后面的代码中获取和设置绑定的转换器?我喜欢这样的东西:
if (converter = x)
converter = y;
else
converter = x;
【问题讨论】:
标签: c# silverlight xaml windows-phone-7 windows-phone-8