Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>();

            Task.Run (async () => {
                await _coffeeService.InitializeAsync();
                this.RunOnUiThread(() =>
                    {
                        this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService);
                    });
            });
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>();

            Task.Run(async() => {
                await _coffeeService.InitializeAsync();
                this.RunOnUiThread(() =>
                {
                    this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService);
                });
            });
        }
Пример #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view     = inflater.Inflate(Resource.Layout.CoffeeListFragment, null);
            var  listView = view.FindViewById <ListView>(Resource.Id.coffee_listview);

            this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>();

            Task.Run(async() =>
            {
                await _coffeeService.InitializeAsync();
                Activity.RunOnUiThread(() =>
                {
                    listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService);
                });
            });

            listView.ItemClick += ListView_ItemClick;

            return(view);
        }
Пример #4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.CoffeeListFragment, null);
            var listView = view.FindViewById<ListView>(Resource.Id.coffee_listview);

            this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>();

            Task.Run(async () =>
            {
                await _coffeeService.InitializeAsync();
                Activity.RunOnUiThread(() =>
                {
                    listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService);
                });
            });

            listView.ItemClick += ListView_ItemClick;

            return view;
        }