Closed alkanna closed 3 years ago
Data binding in walk works by Bind
ing an expression to a declarative struct field of type Property
. To be able to access some data like an instance of your Player
struct, you would use a DataBinder
.
Please have a look at the databinding, gradientcomposite and webview examples.
In case of StatusBarItem
you indeed would have to update the text manually. Data binding in general is limited to stuff embedding WindowBase
.
Thank you very much, that's what I was expecting for the StatusBarItem seeing as its Text field takes a string and not a Property.
Let's say I have a
StatusBarItem
, I would like to be able to bind a variable (currently a global struct, holding some data that is meant to vary) so that the text always reflects the value of this variable.For example, imagine I have a struct :
Can I do something like this ?
I have a hard time figuring it out since there is little doc on the subject :( Do I have to manually reinject the value into the
StatusBarItem
every time I get a new value for it ?