locked
How to bind static functions in windows store apps?

    Question

  • I am trying to bind an image source at multiple places in my application. I can have my view models return this value by calling the static function, but just repeating the same task again and again seems overkill. Is there a way I can bind my static function to the image source directly?

    Thanks in advance

    Sunday, September 28, 2014 12:13 AM

Answers

  • You can not bind to static members, since they can not implement change propagation.

    I would suggest you create the call to the static function only once, in a common view model base class, and let your view models inherit it.

    Monday, September 29, 2014 12:16 PM

All replies

  • Hi,

    I'm afraid that it is not the correct forum about this issue, since this forum is to discuss WPF.

    So I have moved this thread to Windows Store Apps forum for better response.

    Thanks for your understanding.

    Best regards,
    Franklin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 29, 2014 10:31 AM
    Moderator
  • You can not bind to static members, since they can not implement change propagation.

    I would suggest you create the call to the static function only once, in a common view model base class, and let your view models inherit it.

    Monday, September 29, 2014 12:16 PM