0
votes

Currently I'm working on a Win Phone 8.1 project and need some Custom Renderer for ContentPage and NavigationPages.

But when I tried to implement it i saw there is no possibility for overwrite the OnElementChanged Method. After some minutes with DotPeek I saw that those methods not are virtual like on other plattforms. So does anybody have an idea or a workaround for implementing custom rederers on Windows RT?

Tried on Xamarin.Forms: 2.0.0.6490 & 2.1.0.6529

Sincerely

1

1 Answers

1
votes

You can use the Event ElementChanged.

public class MyRender: NavigationPageRenderer
{
    public MyRender()
    {
        ElementChanged += OnElementChanged;
    }

    private void OnElementChanged(object sender, VisualElementChangedEventArgs visualElementChangedEventArgs)
    {
        // do some stuff here
    }
}