Join GitHub today
[MacOS] make OnElementChanged and OnElementPropertyChanged protected virtual #1187
Description of Change
In Xamarin.Forms.Platform.MacOS the PageRenderer and ScrollViewRenderer did not have the usual protected virtual methods OnElementChanged and OnElementPropertyChanged. They were private and partly wrong named. Therefore users could not inherit from those renderers and use them as every other renderer on every other platform.
Good call, but you do raise ElementChanged yourself from CarouselPageRenderer.OnElementChanged, MasterDetailPageRenderer.OnElementChanged, NavigationPageRenderer.OnElementChanged, TabbedPageRenderer.OnElementChanged and even VisualElementRenderer.OnElementChanged.
I changed all the *PageRenderers and ScrollViewRenderer now. The event is now raised in the private Raise(or Handle-)ElementChanged method and the virtual OnElementChanged method is just an empty template method. Thus the ElementChanged event is still raised even if a derived class does not call base.OnElementChanged.
I did not change the VisualElementRenderer as this is used everywhere (also shared with iOS).
and on BindableObject.PropertyChanged too... and you can't start to imagine how we regret it