-2

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?

giacoder
  • 980
  • 8
  • 21

2 Answers2

3

How to declare it in ResourceDictionary?

<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
  • Not sure how this is correct, because your not declaring it in a resourcedictionary – MyKuLLSKI Jan 31 '12 at 15:40
  • @MyKuLLSK - The question was about declaring it in a resource dictionary, not about declaring the resource dictionary itself. – ZombieSheep Jan 31 '12 at 15:54
  • 2
    @ZombieSheep - That doesn't make seance. He already answered his own question then – MyKuLLSKI Jan 31 '12 at 16:00
  • I assumed he had enough brain to write `` himself :-) – Claus Jørgensen Jan 31 '12 at 19:49
  • This answer is correct! I needed to declare it inside resourcedictionary. I also tried as Claus answered, but was receiving an error. I blamed declaring of Converter, but in real the error was because of wrong using of TemplateBinding with Converter. – giacoder Feb 01 '12 at 10:11
1

Add this in App.xaml

  <Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary>
               <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            </ResourceDictionary>
        </ResourceDictionary.MergedDictionaries>
     </ResourceDictionary>
  </Application.Resources>
Community
  • 1
  • 1
MyKuLLSKI
  • 5,285
  • 3
  • 20
  • 39