コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.color_list);

            var adapter = new ColorListAdapter(this, Color.GetColors());
            this.ListAdapter = adapter;
        }
        protected override void OnClick()
        {
            var adapter = new ColorListAdapter(this.Context, DEFINE_COLORS);

            new AlertDialog.Builder(this.Context)
            .SetTitle(this.Title)
            .SetAdapter(adapter,
                        (s, e) =>
            {
                var color  = DEFINE_COLORS [e.Which];
                this.Color = color;
                UpdateColor(color);
            })
            .Show();
        }