New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MacOS] make OnElementChanged and OnElementPropertyChanged protected virtual #1187

Merged
merged 2 commits into from Oct 17, 2017

Conversation

Projects
None yet
4 participants
@MichaelRumpler
Contributor

MichaelRumpler commented Oct 6, 2017

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.

API Changes

Changed:

  • PageRenderer: void OnElementChanged => protected virtual void OnElementChanged
  • PageRenderer: void OnHandlePropertyChanged => protected virtual void OnElementPropertyChanged
  • ScrollViewRenderer: void OnElementChanged => protected virtual void OnElementChanged
  • ScrollViewRenderer: void HandlePropertyChanged => protected virtual void OnElementPropertyChanged

Behavioral Changes

None

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@StephaneDelcroix

fine for me, minus the comment

@MichaelRumpler

This comment has been minimized.

Show comment
Hide comment
@MichaelRumpler

MichaelRumpler Oct 9, 2017

Contributor

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).

Contributor

MichaelRumpler commented Oct 9, 2017

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).

@StephaneDelcroix

This comment has been minimized.

Show comment
Hide comment
@StephaneDelcroix

StephaneDelcroix Oct 9, 2017

Member

@MichaelRumpler

but you do raise ElementChanged yourself from CarouselPageRenderer.OnElementChanged, MasterDetailPageRenderer.OnElementChanged, NavigationPageRenderer.OnElementChanged, TabbedPageRenderer.OnElementChanged and even VisualElementRenderer.OnElementChanged.

and on BindableObject.PropertyChanged too... and you can't start to imagine how we regret it

Member

StephaneDelcroix commented Oct 9, 2017

@MichaelRumpler

but you do raise ElementChanged yourself from CarouselPageRenderer.OnElementChanged, MasterDetailPageRenderer.OnElementChanged, NavigationPageRenderer.OnElementChanged, TabbedPageRenderer.OnElementChanged and even VisualElementRenderer.OnElementChanged.

and on BindableObject.PropertyChanged too... and you can't start to imagine how we regret it

@StephaneDelcroix StephaneDelcroix merged commit 347c340 into xamarin:master Oct 17, 2017

9 of 13 checks passed

VSTS: Android API19 Validation Fast Renderers UITests Finished
Details
VSTS: Android API23 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API25 Validation Legacy Renderers UITests Finished
Details
VSTS: iOS 11 Validation UITests Finished
Details
VSTS: Android API19 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API23 Validation Fast Renderers UITests Finished
Details
VSTS: Android API25 Validation Fast Renderers UITests Finished
Details
VSTS: Xamarin Forms OSX pull-1187 - (1064435) Succeeded
Details
VSTS: Xamarin Forms Windows 1067257 Succeeded
Details
VSTS: Xamarin Forms Windows (PR Builds) Started PR process 1050360
Details
VSTS: iOS Validation UITests Finished
Details
Windows-Debug-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Debug : Tests passed: 3943, ignored: 18
Details
Windows-Release-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Release Unit Tests : Tests passed: 3943, ignored: 18
Details

@samhouts samhouts added this to the 3.0.0 milestone May 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment