Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.Title = "OxyPlot Example Browser";

            var examples   = Examples.GetList();
            var categories = examples.Select(e => e.Category).Distinct().OrderBy(s => s).ToList();

            ListAdapter = new ArrayAdapter <string>(this, Resource.Layout.ListItem, categories);
            ListView.TextFilterEnabled = true;
            ListView.ItemClick        += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                var category = categories[args.Position];
                var second   = new Intent(this, typeof(ExampleListActivity));
                second.PutExtra("category", category);
                StartActivity(second);
            };
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var category = Intent.GetStringExtra("category");

            this.Title = category;

            var examples = Examples.GetList();
            var plots    = examples.Where(e => e.Category == category).Select(e => e.Title).OrderBy(s => s).ToList();

            ListAdapter = new ArrayAdapter <string>(this, Resource.Layout.ListItem, plots);
            ListView.TextFilterEnabled = true;
            ListView.ItemClick        += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                // When clicked, show a toast with the TextView text
                Toast.MakeText(Application, ((TextView)args.View).Text, ToastLength.Short).Show();
                var second = new Intent(this, typeof(PlotActivity));

                second.PutExtra("category", category);
                second.PutExtra("plot", plots[args.Position]);
                StartActivity(second);
            };
        }