1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using Foundation;
using System.Collections.Generic;
 
namespace Shared
{
    public static class PickerView
    {
        public static void Show(List<KeyValuePair<string, string[]>> list, Action<string> action, string sure = "Sure", string beforeValue = "")
        {
            var tempList = new List<NSDictionary>();
            foreach (KeyValuePair<string, string[]> 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<string> list, Action<string> 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);
                }
            });
        }
    }
}