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

DeConstructor or Dispose not called not custom renderer

$
0
0

I am using custom renderer in my xamarin.forms project. But i am facing performance issue on android platform. I need to know why DeConstructor or Dispose not calling when the page is destroyed. But constructor is calling when page(contains extendedButton) is created. Anyone have any idea why this is not calling.

public class ExtendedButtonRenderer : ButtonRenderer
{
    public ExtendedButtonRenderer ()
    {
        Console.WriteLine ("Constructor");
    }

    ~ExtendedButtonRenderer ()
    {
        Console.WriteLine ("DeConstructor");
    }

    protected override void Dispose (bool disposing)
    {
        Console.WriteLine ("Dispose");
        base.Dispose (disposing);
    }


    protected override void OnElementChanged (ElementChangedEventArgs<Button> e)
    {
        base.OnElementChanged (e);
    }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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