Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.Title = "Routes";

            var source = new MvxSimpleTableViewSource(RoutesTable, RouteCell.Key, RouteCell.Key);

            RoutesTable.Source = source;

            var bindingSet = this.CreateBindingSet <RoutesView, RoutesViewModel>();

            bindingSet.Bind(StationsButton).To(vm => vm.NavigateToStationsCommand);
            bindingSet.Bind(source).To(vm => vm.RouteList);
            bindingSet.Bind(source).For(s => s.SelectedItem).To(vm => vm.SelectedRoute);
            bindingSet.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.NavigateToFilteredStationsCommand);

            bindingSet.Apply();

            RoutesTable.ReloadData();

            RoutesViewModel.FinishNotificationEvent += OnFinishFetchData;
        }
Esempio n. 2
0
        private async void OnFinishFetchData(object sender, EventArgs eventArgs)
        {
            await Task.Delay(250);

            RoutesTable.ReloadData();
        }