locked
Xaml will not let me include IValueConverter as a resource RRS feed

  • Question

  • I have a converter implemented using the IValueConverter interface. In my code, I have the following in my Page tag:

    xmlns:ctrl=using:MyProjectNamespace

    And I have the following in the Resources section of my page:

    <ctrl:MyConverter x:Key="myconverter"/>

    When I enter this, MyConverter is included in the dropdown, but I get the following error when selecting it:

    The name "MyConverter" does not exist in the namespace "using:MyProjectNamespace".

    The IValueConverter is defined in the same project as the page. What am I doing wrong?


    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/


    • Edited by Nathan Sokalski Sunday, November 17, 2013 4:05 AM Missing information
    Sunday, November 17, 2013 4:02 AM

Answers

  • Hello Nathan Sokalski,

    try to create one class & give that name as abc than that class use like ivalueconverter. show this link :

    http://eren.ws/2013/03/04/using-ivalueconverter-in-windows-store-apps/

    And give reference same as you give as you.

    Sunday, November 17, 2013 6:53 AM
  • I have no idea what it is that goes on sometimes, but once again my code was correct and when I turned my computer on the next day the code worked. Does Visual Studio just enjoy teasing me sometimes of something?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Sunday, November 17, 2013 4:26 PM

All replies

  • Hello Nathan Sokalski,

    try to create one class & give that name as abc than that class use like ivalueconverter. show this link :

    http://eren.ws/2013/03/04/using-ivalueconverter-in-windows-store-apps/

    And give reference same as you give as you.

    Sunday, November 17, 2013 6:53 AM
  • I have no idea what it is that goes on sometimes, but once again my code was correct and when I turned my computer on the next day the code worked. Does Visual Studio just enjoy teasing me sometimes of something?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Sunday, November 17, 2013 4:26 PM
  • I have faced the same problem like you. Just go to BUILD-->Clean Project, then build your project again, and after all, VS does not fool us. Have fun.
    Monday, September 29, 2014 5:48 PM