oneManArmin
oneManArmin

Reputation: 706

Visual Studio Xamarin with C# and XAML: Alternative to WPF-like Data Bindig?

I'm creating a simple App in which some view elements are generated programmatically on runtime. I want some of the properties of these views to be bound to data (text for example), but I do not know how this is done in Android.

I'm familiar with WPF, where this is achieved with Data Binding, but this is not supported in Xamarin (unless I use something 3rd party like MVVMCross, which I'd rather avoid or an approach like THIS). So my qustion is: What is the best way to bind UI elements to data in Android? What is the common practise in, say, Android Studio, and how could I implement it in Xamarin with C#? I have something like THIS in mind, but this is Android Studio (I guess), so it won't work in Xamarin.

Upvotes: 0

Views: 503

Answers (1)

Trevor Hart
Trevor Hart

Reputation: 1023

You would need to add your own implementation to do this if you don't want to use a third part library, Microsoft has data binding in wpf because they implemented it, Xamarin is just a wrapper around android, and android doesn't have this functionality as far as I know. It's sort of like how JavaScript doesn't support data binding but angular does, it's a third party thing most of the time. That said, to answer your question better, your options are use third party or implement your own library.

Upvotes: 1

Related Questions