Bug 60447 - PresentationLayer should be read-only, differs from behavior in iOS
Summary: PresentationLayer should be read-only, differs from behavior in iOS
Status: NEW
Alias: None
Product: Workbooks & Inspector
Classification: Xamarin
Component: Agent: iOS ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: xamarininteractive
URL:
Depends on:
Blocks:
 
Reported: 2017-10-30 22:35 UTC by Mike Norman
Modified: 2017-10-30 22:37 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Custom Layer and View animation that shows use of Layer (13.26 KB, application/zip)
2017-10-30 22:35 UTC, Mike Norman
Details
Workbook showing PresentationLayer assignment bug (1.27 KB, text/plain)
2017-10-30 22:37 UTC, Mike Norman
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 60447 on Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:
Status:
NEW

Description Mike Norman 2017-10-30 22:35:03 UTC
Created attachment 25508 [details]
Custom Layer and View animation that shows use of Layer

Repro:
In a workbook, create a custom layer and custom view. In the ActionForKey override, access the UIView.Layer.PresentationLayer.CornerRadius property. Now, do the same in a solution. And then access the subtly shorter UIView.Layer.CornerRadius property.

Expected:
It's complicated. The PresentationLayer is a copy of the View's layer for information and calculation. Assigning to it is allowed, but has no effect, on iOS. Assigning UIView.Layer.CornerRadius is the way implicit animations are created (with other finagling.)

Actual:
In a solution running on iOS, NullReferenceException on the PresentationLayer if the view has not been displayed. Otherwise, in a solution, success and a no-op. In a workbook, success, and the animation happens (with the finagling mentioned above).

Discussion:
The desired behavior for the workbook is, since the view has been displayed, that the assignment not throw an exception, but have no result. The user should be required to assign to UIView.Layer.CornerRadius, and/or UIView.CornerRadius.

The attached solution is patterned after Erica Sadun's implicit animation blog post. (http://www.informit.com/articles/article.aspx?p=2233980) I will be attaching a similarly patterned workbook that has the incorrect behavior, shortly.
Comment 1 Mike Norman 2017-10-30 22:37:17 UTC
Created attachment 25509 [details]
Workbook showing PresentationLayer assignment bug

The assignment to PresentationLayer.CornerRadius should succeed, but not cause animation. In reality, it succeeds and acts as if it were an assignment to Layer.CornerRadius, triggering the animation.