Data binding in UWP

Anbie 21 Reputation points

What is the diffrence between binding and x:bind.
My xaml code works fine when I change to binding.
But I can not share my code, I also try to upload image, it fail as well. How can I share my code?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Fay Wang - MSFT 5,201 Reputation points


    Welcome to our Microsoft Q&A platform!

    >>What is the diffrence between binding and x:bind?

    First the datacontext of x:bind is current page, it will find the property in the current Code-Bebind class. But you need to set DataContext explicitly for binding. And the default mode of x:bind is oneTime, it means it will change the value one time. In addition, x:bind generates source code at compile-time, the binding will take effect at runtime, so x:bind is more faster. For more details about their difference, you can refer to this document.

    >>How can I share my code?

    What is your problem? What behavior do you want? And what behavior are you getting now? Can you share more details about it? If you need to upload your code, you can share it as a normal text.


0 additional answers

Sort by: Most helpful