问题
On the page we declare a converter as
<phone:PhoneApplicationPage.Resources>
<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
</phone:PhoneApplicationPage.Resources>
How to declare it in ResourceDictionary?
回答1:
How to declare it in ResourceDictionary?
<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
回答2:
Add this in App.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
来源:https://stackoverflow.com/questions/9078789/wp7-converter-in-resourcedictionary