public async Task LoadAsync(ICoffeeListModeHandler coffeeListModeHandler)
        {
            _coffeeListModeHandler = coffeeListModeHandler;
            await _coffeeService.InitializeAsync();

            Records        = _coffeeService.Records;
            SelectedRecord = Records.FirstOrDefault();
        }
Example #2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            await _service.InitializeAsync();

            this.ListCoffee.ItemsSource   = _service.Records.Select(it => it.fields.nom_du_cafe);
            this.ListCoffee.ItemSelected += ListCoffee_ItemSelected;
        }
Example #3
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);
                    });
            });
        }
Example #4
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);
                });
            });
        }
Example #5
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            try
            {
                await _coffeeService.InitializeAsync();

                TableView.Source = new CoffeeTableSource(this, _coffeeService);
                TableView.ReloadData();
            }
            catch (Exception e) {
                // TRAITER L'ERREUR
            }
        }
Example #6
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);
        }
Example #7
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;
        }
Example #8
0
        public override async void WillActivate()
        {
            base.WillActivate();

            await _coffeeService.InitializeAsync();

            this.CoffeeTable.SetNumberOfRows(_coffeeService.Count, "default");

            var records = _coffeeService.Records;

            int i = 0;

            foreach (var record in records)
            {
                var recordFields = record.fields;
                var coffeeName   = recordFields.nom_du_cafe;

                var rowController = (CoffeeTableRowController)CoffeeTable.GetRowController((nint)i);
                rowController.SetLabelText(coffeeName);

                i++;
            }
        }
Example #9
0
        public async Task StartAsync()
        {
            await _coffeeService.InitializeAsync();

            Records = new ObservableCollection <Record>(_coffeeService.Records);
        }