protected override void OnDisappearing()
        {
            DelayViewModel.StopConnection();
            StopTimer();

            base.OnDisappearing();
        }
 public DelaysPage(StopModel stop)
 {
     InitializeComponent();
     Title          = stop.StopDesc;
     Items          = new ObservableCollection <DelayModel>();
     DelayViewModel = new DelayViewModel(stop.StopId);
 }
        async void UpdateDataEvent(object sender, ElapsedEventArgs e)
        {
            Items = await DelayViewModel.SetItems();

            Device.BeginInvokeOnMainThread(() =>
            {
                SetVisibility();
                DelayListView.ItemsSource = Items;
            });
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            await DelayViewModel.StartConnection();

            DelayListView.RefreshAllowed = true;
            Items = await DelayViewModel.SetItems();

            SetVisibility();
            BindingContext = DelayViewModel;
            SetTimer();
        }
        private void OK(IDialogWindow window)
        {
            if (StepType == null)
            {
                return;
            }

            StepViewModel stepViewModel;

            switch (StepType.Content)
            {
            case "Delay":
                stepViewModel = new DelayViewModel();
                break;

            case "Tilt":
                stepViewModel = new TiltViewModel();
                break;

            case "Rotation":
                stepViewModel = new RotationViewModel();
                break;

            case "Extension":
                stepViewModel = new ExtensionViewModel();
                break;

            case "Home":
                stepViewModel = new HomeViewModel();
                break;

            case "End Effector":
                stepViewModel = new EndEffectorViewModel();
                break;

            default:
                stepViewModel = null;
                break;
            }
            CloseDialogWithResult(window, stepViewModel);
        }
Esempio n. 6
0
    private void TypeComboBox_Selected(object sender, RoutedEventArgs e)
    {
        if (!IsLoaded)
        {
            return;
        }

        if (TypeComboBox.SelectedIndex < 1)
        {
            MainPresenter.Content = null;
            return;
        }

        if (!IsEditing)
        {
            //Create a new model.
            switch ((TaskTypes)TypeComboBox.SelectedIndex)
            {
            case TaskTypes.MouseClicks:
                CurrentTask = MouseClicksViewModel.Default();
                break;

            case TaskTypes.KeyStrokes:
                CurrentTask = KeyStrokesViewModel.Default();
                break;

            case TaskTypes.Delay:
                CurrentTask = DelayViewModel.Default();
                break;

            case TaskTypes.Progress:
                CurrentTask = ProgressViewModel.Default();
                break;

            case TaskTypes.Border:
                CurrentTask = BorderViewModel.Default();
                break;

            case TaskTypes.Shadow:
                CurrentTask = ShadowViewModel.Default();
                break;
            }
        }

        switch ((TaskTypes)TypeComboBox.SelectedIndex)
        {
        case TaskTypes.MouseClicks:
            MainPresenter.Content = new MouseClicksPanel {
                DataContext = CurrentTask
            };
            break;

        case TaskTypes.KeyStrokes:
            MainPresenter.Content = new KeyStrokesPanel {
                DataContext = CurrentTask
            };
            break;

        case TaskTypes.Delay:
            MainPresenter.Content = new DelayPanel {
                DataContext = CurrentTask
            };
            break;

        case TaskTypes.Progress:
            MainPresenter.Content = new ProgressPanel {
                DataContext = CurrentTask
            };
            break;

        case TaskTypes.Border:
            MainPresenter.Content = new BorderPanel {
                DataContext = CurrentTask
            };
            break;

        case TaskTypes.Shadow:
            MainPresenter.Content = new ShadowPanel {
                DataContext = CurrentTask
            };
            break;
        }
    }