using System; using Foundation; using System.Collections.Generic; namespace Shared { public static class PickerView { public static void Show(List> list, Action action, string sure = "Sure", string beforeValue = "") { var tempList = new List(); foreach (KeyValuePair kv in list) { tempList.Add(NSDictionary.FromObjectAndKey(NSArray.FromStrings(kv.Value), new NSString(kv.Key))); } var nSArray = NSArray.FromNSObjects(tempList.ToArray()); ZJPickerView.Zj_showWithDataList(nSArray, NSDictionary.FromObjectsAndKeys(new NSString[]{ new NSString(beforeValue), new NSString(sure), }, new NSString[] { Constants.ZJPickerViewPropertyTipLabelTextKey , Constants.ZJPickerViewPropertySureBtnTitleKey }), (s) => { if (action != null) { action(s); } }); } public static void Show(List list, Action action, string sure = "Sure", string beforeValue = "") { ZJPickerView.Zj_showWithDataList(NSArray.FromObjects(list.ToArray()), NSDictionary.FromObjectsAndKeys(new NSString[]{ new NSString(beforeValue), new NSString(sure), }, new NSString[] { Constants.ZJPickerViewPropertyTipLabelTextKey , Constants.ZJPickerViewPropertySureBtnTitleKey }), (s) => { if (action != null) { action(s); } }); } } }