简体   繁体   中英

what is the advantage of using viewmodel commands as compared to the view's click events in xamarin forms

I would like know the advantage of using commands in viewmodel in xamarin as compared to the click event handlers in the view class. Click events seems simpler to use. Please point out the pros and cons of both approches.

Thanks

Click events are tightly bound to your view and cannot be unit test. Using commands in view model makes the testing process very easy. This is a great view which will help clear thing up in detail. view models and unit testing

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