Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Binding Source

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

Hi,

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.

Tagged:

Best Answer

Answers

Sign In or Register to comment.