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

            SetContentView(Resource.Layout.EmergencyList);

            var nav = (NavigationService)SimpleIoc.Default.GetInstance <INavigationService>();

            Vm.LoadEmergencies(nav.GetAndRemoveParameter <string>(Intent));

            emergencies = FindViewById <ListView>(Resource.Id.listViewEmergencies);

            _bindings.Add(this.SetBinding(() => Vm.IsBusy).WhenSourceChanges(() =>
            {
                if (Vm.IsBusy)
                {
                    loading.Visibility = ViewStates.Visible;
                }
                else
                {
                    loading.Visibility = ViewStates.Invisible;
                }
            }));

            emergencies.Adapter = Vm.Emergencies.GetAdapter(EmergencyAdapter);

            ReportButton.Click += (s, e) =>
            {
                GetCheckedItemsAndPasstoVm();
            };

            GalaSoft.MvvmLight.Messaging.Messenger.Default.Register <NotificationMessage>(this, HandleDoneSending);
        }