Exemplo n.º 1
0
        /// <summary>
        /// Initialise les objets de la vue avec les données
        /// </summary>
        private void SetDataToView()
        {
            //Initialise le mode don't move
            App.Locator.ModeFollowMe.InitModeFollowMe();

            if (App.Locator.ModeFollowMe.IsWaitingForValidation)
            {
                StatusTextView.SetText(Resource.String.modeFollowMe_explanations);
                var adapter = ArrayAdapter.CreateFromResource(Context
                                                              , Resource.Array.refreshTime_array
                                                              , Resource.Layout.AddSeekiosSpinnerText);
                adapter.SetDropDownViewResource(Resource.Layout.SpinnerDropDownItem);
                RefreshTimeSpinner.Adapter            = adapter;
                TrackingAfterDisconnectSwitch.Checked = App.Locator.ModeFollowMe.IsTrackingAfterBLEConnexionLoss;
                RefreshTimeSpinner.Enabled            = App.Locator.ModeFollowMe.IsTrackingAfterBLEConnexionLoss;
                EditMetaDataLinearLayout.Visibility   = ViewStates.Visible;
                MapMetaDataLinearLayout.Visibility    = ViewStates.Gone;
                SelectCorrectRefreshTimeItem();
            }
            else
            {
                if (MapViewModelBase.Mode.StatusDefinition_idstatusDefinition == 1)
                {
                    StatusTextView.SetText(Resource.String.modeFollowMe_seekiosReachable);
                }
                else
                {
                    StatusTextView.SetText(Resource.String.modeFollowMe_seekiosUnreachable);
                }

                EditMetaDataLinearLayout.Visibility = ViewStates.Gone;
                MapMetaDataLinearLayout.Visibility  = ViewStates.Visible;
                InitializeActivateSinceTextView();
                InitializeCountOfConnectionLossAlertTextView();
                if (App.Locator.ModeFollowMe.IsTrackingAfterBLEConnexionLoss)
                {
                    TrackingRefreshTimeStat.Visibility = ViewStates.Visible;
                    InitializeTrackingRefreshTimeStatTextView();
                    RestartModeRelativeLayout.Visibility = ViewStates.Gone;
                }
                else
                {
                    TrackingRefreshTimeStat.Visibility = ViewStates.Gone;
                    if (MapViewModelBase.Mode != null)
                    {
                        RestartModeRelativeLayout.Visibility = MapViewModelBase.Mode.StatusDefinition_idstatusDefinition == 3 ? ViewStates.Visible : ViewStates.Gone;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnFollowMePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case "Mode":
                if (MapViewModelBase.Mode == null)
                {
                    break;
                }
                RestartModeRelativeLayout.Visibility = MapViewModelBase.Mode.StatusDefinition_idstatusDefinition == 3 ? ViewStates.Visible : ViewStates.Gone;
                break;

            case "BLEConnexionState":
                (ServiceLocator.Current.GetInstance <IDispatchOnUIThread>() as DispatchService).Invoke(() =>
                {
                    switch (App.Locator.ModeFollowMe.BLEConnexionState)
                    {
                    case Interfaces.ConnexionState.None:
                        StatusTextView.SetText(Resource.String.modeFollowMe_explanations);
                        break;

                    case Interfaces.ConnexionState.SeekiosUnreachable:
                        StatusTextView.SetText(Resource.String.modeFollowMe_seekiosUnreachable);
                        break;

                    case Interfaces.ConnexionState.Connecting:
                    case Interfaces.ConnexionState.LookingForSeekios:
                        StatusTextView.SetText(Resource.String.modeFollowMe_lookingForSeekios);
                        break;

                    case Interfaces.ConnexionState.Disconnecting:
                    case Interfaces.ConnexionState.Disconnected:
                        StatusTextView.SetText(Resource.String.modeFollowMe_connexionLost);
                        break;

                    case Interfaces.ConnexionState.Connected:
                        StatusTextView.SetText(Resource.String.modeFollowMe_connected);
                        break;

                    default:
                        break;
                    }
                });
                break;
            }
        }