Exrin: How to setup two way binding between VisualState and ModelState

65 views Asked by At

How is the binding between ModelState and VisualState changed from one way to two way?

In the Exrin introduction on YouTube and in this SO answer, it is stated that there is a binding between the ModelState and the VisualState (specifically ModelState -> VisualState). It is also stated that the binding can be changed from one way to two way.

I did some looking around and did find a BindingType enum with the values being OneWay and TwoWay, but I was unable to find where to utilize these.

1

There are 1 answers

0
Adam On BEST ANSWER

In the VisualState you can add this attribute to any property.

[Binding(BindingType.TwoWay)]
public int PropertyName { get { Get<int>(); } set { Set(value); } }

If there is no attribute it defaults to OneWay binding.