locked
Using Binding and Converter RRS feed

  • Question

  • How can I binding to object, not property?
    I need using binding like this:

    Code Snippet

     <Image Source={Binding, Converter={StaticResource imageConverter}}"/>



    But i recveive error:
    Unknown property 'Converter' for type 'MS.Internal.Markup.MarkupExtensionParser+UnknownMarkupExtension' encountered while parsing a Markup Extension.
    Monday, March 24, 2008 1:23 PM

Answers

  • It work but this should be <jupi>:

     <xyz:MyControl DepencyProperty1="{Binding Converter={StaticResource myMegaConverter}}"/>

    instead of

     <xyz:MyControl DepencyProperty1="{Binding, Converter={StaticResource myMegaConverter}}"/>

    Wednesday, March 26, 2008 4:38 PM

All replies

  • Thanks, but my qeustion is not about imaging. It is about binding.
     Maybe i take another sample:

    Code Snippet

     <xyz:MyControl DepencyProperty1={Binding, Converter={StaticResource myMegaConverter}}"/>


    Monday, March 24, 2008 2:12 PM
  • So what's the difference between your last and first posts in the markup?

    I see only another control and the same approach.

    Don't forget setting the path of the binding.

    Monday, March 24, 2008 2:15 PM
  • I know, i want to show only main point of my problem;-)
    Monday, March 24, 2008 2:18 PM
  • Don't take it offensive but this is not a chat and I can't pull details to address the issue post after post. If you have reasons not to disclose details of your bindings and classes you are dealing with just look through the basic MSDN materials towards databinding and value converters.

    Besides you can use the following links to get a better understanding what are you dealing with

     

    Data Binding How-to Topics

    http://msdn2.microsoft.com/en-us/library/ms752039.aspx

     

    WPF: using IValueConverter

    Data Binding with Value Converters

     

    IValueConverter and WPF

    http://www.wiredprairie.us/journal/2006/05/ivalueconverter_and_wpf.html

     

    Monday, March 24, 2008 2:59 PM
  • I don't  take it offensive :-). I read all in this sites, but i didn't find my scenerio Sad

    I trying like this:
    Code Snippet

     <xyz:MyControl DepencyProperty1={Binding Path=\, Converter={StaticResource myMegaConverter}}"/>



    But WPF push to myMegaConverer a null object.
    Monday, March 24, 2008 5:50 PM
  • The binding statement should be:

     <xyz:MyControl DepencyProperty1="{Binding, Converter={StaticResource myMegaConverter}}"/>

    instead of

     <xyz:MyControl DepencyProperty1={Binding, Converter={StaticResource myMegaConverter}}"/>

    Please pay attention to the left quotation mark.

    hope this helps
    Wednesday, March 26, 2008 3:20 AM
  • But I have still the same error:
    "Unknown property 'Converter' for type 'MS.Internal.Markup.MarkupExtensionParser+UnknownMarkupExtension' encountered while parsing a Markup Extension."

    In my source i was left quotation :-)
    Wednesday, March 26, 2008 9:46 AM
  •  Benys wrote:
    But I have still the same error:
    "Unknown property 'Converter' for type 'MS.Internal.Markup.MarkupExtensionParser+UnknownMarkupExtension' encountered while parsing a Markup Extension."

    In my source i was left quotation :-)

     

    Oh my,

    Check out my profile to get the email address. Cook simple application addressing the issue and send it to me. I'll send you the reviewed version that is working.

    Wednesday, March 26, 2008 9:50 AM
  • It work but this should be <jupi>:

     <xyz:MyControl DepencyProperty1="{Binding Converter={StaticResource myMegaConverter}}"/>

    instead of

     <xyz:MyControl DepencyProperty1="{Binding, Converter={StaticResource myMegaConverter}}"/>

    Wednesday, March 26, 2008 4:38 PM