Exemple #1
0
        private void currencies_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            CurrencyExchangeViewAdapter adapter = (CurrencyExchangeViewAdapter)((ListView)sender).Adapter;

            adapter.CurrencySelected = currencies[e.Position];
            adapter.NotifyDataSetChanged();
            Console.WriteLine(adapter.CurrencySelected.Name);
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            mainView   = FindViewById <ListView>(Resource.Id.mainListView);
            currencies = CurrencyLoader.LoadCurrencies();
            currencies.Sort();

            var adapter = new CurrencyExchangeViewAdapter(this, currencies, 0);

            mainView.Adapter        = adapter;
            mainView.ItemLongClick += currencies_ItemLongClick;
            // SetContentView (Resource.Layout.Main);
        }