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

Singleton Instance of ViewModels

$
0
0

Hello,

I have 3 screens in my app- Home, B and C.

Home screen has toolbar which can be used to navigate to A or B. I navigate to A from Home using button. This creates a new instance of VM with A. Then I navigate from A to B, this creates a new instance of VM for B. Now I click on button for screen A again on toolbar, this again creates a new instance of VM for A instead of using the instance which is already present. Is this an okay practice or is there a way to navigate to the same instance of A that was created first.

Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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