1
votes

In Xamarin Froms is there any more cleaner way to make applications rather than using 2way data binding, MVVM?

I tried to use it but, it that kind of workflow really doesn't fits me. and couldn't find any other smart ways to do it.

if yes, then how should I implement the MVC architecture?

or in xamarin ios or android would mvc workflow work?

something not like this in XAML file

<TextBox Text="{Binding Path=Salary, Mode=TwoWay}"/>
1

1 Answers

1
votes

You can always just access you view from your codebehind and set values there. Just think of the Codebehind as your controller, and bam, welcome to MVC world.

Assume you have some Xaml like this (MainPage.xaml):

<Label x:Name="MyLabel" />

In the codebehind (aka the MainPage.xaml.cs):

this.MyLabel.Text = "Hello world!"

The main reason to go with MVVM is Databinding. Once you got how it works, it helps you having much cleaner UI Code and the effort learning it is propably worth it, as the whole Xamarin.Forms framework is designed specifically for it.