Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

MVVM best practise to access pages elements in viewmodel

$
0
0

Hi Guys,
i am new into mobile app developing and also into xamarin forms.
i build a xamarin forms application and i try to use the mvvm pattern.

What i try to achieve is like a simple form post in web developing.

I have a ContentPage (MyPage.xaml) with multiple Entrys, a ViewModel (MyPageViewModel.cs) which is bound to the ContentPage and my code behind (MyPage.xaml.cs). As far as i understood all the business logic should be in the ViewModel.

What i am now trying to do is reading all the data the user wrote into the entrys and afterwards i do whatever i want to do with this data.
How can i access the view elements in my viewmodel?

Or what is the best practice to work with the pages elements? In the code behind i can access them via this.findbyname("name").

Thank you for your help, Gelatto


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>