Forum Xamarin.iOS

NSComboBoxDelegate

skylarkskylark JPMember

Hi, all.

I think Xamarin.Mac is not support NSComboBoxDelegate.
How can i catch "comboboxSelectionDidChange"?

Posts

  • rjmrjm CAMember ✭✭✭

    You can use the WeakDelegate property. e.g.

    myComboBox.WeakDelegate = new Delegate();
    
    private class Delegate : NSObject
    {
        // - (void)comboBoxSelectionDidChange:(NSNotification *)notification
        [Export("comboBoxSelectionDidChange:")]
        public void SelectionDidChange(NSNotification notification)
        {
            var sender = notification.Object as NSComboBox;
            Console.WriteLine(sender.SelectedIndex);
        }
    }
    
  • skylarkskylark JPMember

    it works. thank you once again!

Sign In or Register to comment.