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

Custom view single instance

$
0
0

I have created a custom view in my PCL project which is used on 2 XAML pages. The custom view has a timer which is started and stopped according to if the view is displayed or not.

It appears though that only 1 instance of the custom view is created and used on both pages!
Due to the asynchronous nature of the views if I stop the timer when I remove one view and start it when I display the second view and the start is called before the stop then the timer does not run!

I have tried using a different x:Name for the view but it still appears to work the same.

I am working on a solution to the problem but I would have thought they would have been separate instances. Unless the issue is with the timer!


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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