How to set binding on a ImageButton in Mvvm Light.

I'm working on a project and I understand the idea of setting binding on a regular button per the example below:

var backButtonBinding = this.SetBinding(() => BackButton.Text);

But I cannot use the .Text on a ImageButton so how do I set the Binding?

Answers

  • stvansolanostvansolano UMInsider, University ✭✭✭

    Hello @MarkBasler.3014 have you tried using a Converter for the binding?

  • yammak2004yammak2004 USMember ✭✭

    No I haven't do you happen to have an example?

  • yammak2004yammak2004 USMember ✭✭

    @ashalva I should have been more specific in my question but I'm using Mvvm Light and I need to user there SetBinding.... My Apologies.

  • ashalvaashalva GEMember ✭✭✭

    I have used MVVMCross not MVVMlight, but actually there must be similarities.

    Ok, as I looked in overloads, 5th one takes sourcePropertyName, where you should pass "Title" and fill other parameters. The "Title" is the text on the imageButton. This is the last thing, what I can suggest to you.

    Hope somehow it helps.

Sign In or Register to comment.