Bug 35715 - UIKeyCommand should have .ctor or Create method that takes an Action<UIKeyCommand> (and expose it as a Property)
Summary: UIKeyCommand should have .ctor or Create method that takes an Action<UIKeyCom...
Status: NEW
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 9.4 (iOS 9.2)
Hardware: PC Mac OS
: Low enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-09 19:52 UTC by Larry O'Brien
Modified: 2016-04-12 15:27 UTC (History)
2 users (show)

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

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 35715 on Developer Community or GitHub 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 or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Larry O'Brien 2015-11-09 19:52:43 UTC
UIKeyCommand's purpose is to fire an `Action<KeyCommand>`, which we currently allow via the Create method:

static hidebysig class MonoTouch.UIKit.UIKeyCommand Create(class MonoTouch.Foundation.NSString keyCommandInput, valuetype MonoTouch.UIKit.UIKeyModifierFlags modifierFlags, class MonoTouch.ObjCRuntime.Selector action)

This requires code like this:

        [Export("NewFileAccelerator:")]
        void NewFileAccelerator(UIKeyCommand cmd)
        {
           //etc...
        }

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();

            var actionSelector = new Selector("NewFileAccelerator:");
            accelerator = UIKeyCommand.Create((NSString) "N", UIKeyModifierFlags.Command, actionSelector);

            AddKeyCommand(accelerator);
        }

which would be improved if we could expose a .ctor or factory method that takes an `Action<UIKeyCommand>` rather a `Selector`.