Data binding in UWP

Anbie 21 Reputation points
2019-11-08T08:29:00.797+00:00

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,216 Reputation points
    2019-11-08T09:21:44+00:00

    Hello,​

    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.

    Thanks.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.