Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I am using the following notification binding:
NSNotificationCenter.DefaultCenter.AddObserver (new NSString("UIKeyboardWillShowNotification"), OnKeyboardShown, null);
And I am attempting to get the value of "UIKeyboardAnimationCurveUserInfoKey" and "UIKeyboardAnimationDurationUserInfoKey" into .NET data types from the NSValue objects returned by NSNotification. It was recommended by IRC users that I submit a bug for Miguel.
I just realized there is a "UIKeyboard.AnimationCurveFromNotification" method which should solve this issue. This seems like an odd/special case method. Please close this bug if this is intended.
Also, the UIKeyboard helper method of "UIKeyboard.FrameEndFromNotification" does not return the same value as "((NSValue)notice.UserInfo[new NSString("UIKeyboardFrameEndUserInfoKey")]).RectangleFValue" which I think it should.
Good catch (comment #2), a parameter was ignored leading to the wrong value being used.
fixed in c83016f832c1bc8e44b7b3d97d45ce34cac045df (master)
Your code should work fine until a newer MonoTouch is released (the one from MonoTouch presently always uses BoundsUserInfoKey).
As for comment #1 the method exists to provide an easier, type safe, version of what would be required for an 1-to-1 ObjectiveC port. You can still do it manually (like you did) but the extra methods feels more C#-py :-)