简体   繁体   中英

set the value of Entry using Binding [Xamarin.Forms]

I want to set the value of Entry using Binding. My simple question is that, how may I use the value of C# class variable in XML page through Binding.?

Here is the screenshot of my XML Page 在此处输入图片说明

Here is the screenshot of Class File 在此处输入图片说明

is it possible in Xamarin.Forms (Portable)?

The simple logic for this requirement is that, in future if I have to change the color or text or anything then I don't have to do to each file and change text.

You can only bind to public properties.

XAML:

<Entry Color="{Binding EntryColor}" />

C#:

public Color EntryColor { get { return Color.White; } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM