Forum Xamarin.Forms

Binding Source

Steve1000Steve1000 Member ✭✭✭
edited August 2020 in Xamarin.Forms


I want to set a string in another class say App.Xaml.cs

public string MyValue = "somevalue";

How can i bind the text of a label to that MyValue item? I'm not sure how the Databinding source works or how I need to wire it up.

I've tried this which didnt work...

<Label Text = {Binding MyValue, Source={x:Static local:App.MyValue}} />

I've got a static piece of text that I want to display on multiple pages so thought to put it in one place and then try and bind to that so that when I need to change it i can change it in one place.


Best Answer


Sign In or Register to comment.