WP7 Converter in ResourceDictionary

吃可爱长大的小学妹 提交于 2019-12-25 18:56:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!