partial void changeChannel(AppKit.NSPopUpButton sender) { var previousChannel = CurrentInterface.WlanChannel; var selectedChannel = CurrentInterface.SupportedWlanChannels.Where(channel => string.Format("{0} {1}", channel.ChannelNumber, channel.ChannelBand) == channelPicker.SelectedItem.Title).First(); NSError error; CurrentInterface.SetWlanChannel(selectedChannel, out error); if (error != null) { Console.WriteLine("Error occurred while changing interface channel: {0}", error.LocalizedDescription); CurrentInterface.SetWlanChannel(previousChannel, out error); channelPicker.SelectItem(string.Format("{0} {1}", previousChannel.ChannelNumber, previousChannel.ChannelBand)); } }