public async Task LoadAsync(ICoffeeListModeHandler coffeeListModeHandler) { _coffeeListModeHandler = coffeeListModeHandler; await _coffeeService.InitializeAsync(); Records = _coffeeService.Records; SelectedRecord = Records.FirstOrDefault(); }
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; }
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); }); }); }
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); }); }); }
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 } }
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); }
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; }
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++; } }
public async Task StartAsync() { await _coffeeService.InitializeAsync(); Records = new ObservableCollection <Record>(_coffeeService.Records); }