Beispiel #1
0
 private void OnDeleteClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     _memoPlayerViewModel.Remove();
     StopMemoPlaying();
 }
Beispiel #2
0
        private void OnBeginPlayerStoryboardCompleted(object sender, EventArgs e)
        {
            _mode = MainPageMode.MemoPlaying;

            _memoPlayerViewModel.Play();
            EnableApplicationBar();
        }
Beispiel #3
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            switch (_mode)
            {
            case MainPageMode.MainView:
                base.OnBackKeyPress(e);
                break;

            case MainPageMode.MemoRecording:
                _mode = MainPageMode.MainView;
                StopMemoRecording();
                e.Cancel = true;
                break;

            case MainPageMode.MemoPlaying:
                _mode = MainPageMode.MainView;
                StopMemoPlaying();
                e.Cancel = true;
                break;

            default:
                break;
            }
        }
Beispiel #4
0
        private void OnPlayCompleted()
        {
            _mode = MainPageMode.MainView;

            _memoPlayerViewModel.Stop();
            StopPlayerStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);
        }
Beispiel #5
0
        private void OnRecordingTimeout()
        {
            _mode = MainPageMode.MainView;

            StopRecorderStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);

            DisableApplicationBar();
        }
Beispiel #6
0
        public MasterDetailPage1(MainPageMode mode = MainPageMode.Default)
        {
            NavigationPage.SetHasNavigationBar(this, false);
            InitializeComponent();

            Messenger.Default.Register <MenuItemSelectedMessage>(this, OnMenuItemSelected);


            switch (SettingsService.Instance.ApplicationMode)
            {
            case ApplicationModeEnum.Portal:
                if (mode == MainPageMode.PortalSuperUser)
                {
                    Detail = new NavigationPage(new SuperUserAccountsPage());
                }
                else
                {
                    Detail = new NavigationPage(new MasterDetailPage1Detail());
                }

                break;

            case ApplicationModeEnum.Driver:
                Detail = new NavigationPage(new DrvRoutesPage());
                break;

            case ApplicationModeEnum.Pipeline:
                if (mode == MainPageMode.CalledFromPipelineCustomerScreen)
                {
                    Detail = new NavigationPage(new MasterDetailPage1Detail());
                }
                else
                {
                    Detail = mode == MainPageMode.OpenInPipelineAccounts ?
                             new NavigationPage(new PipelineAccountsPage())
                            : new NavigationPage(new PipelinePage());
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            switch (_mode)
            {
                case MainPageMode.MainView:
                    base.OnBackKeyPress(e);
                    break;

                case MainPageMode.MemoRecording:
                    _mode = MainPageMode.MainView;
                    StopMemoRecording();
                    e.Cancel = true;
                    break;

                case MainPageMode.MemoPlaying:
                    _mode = MainPageMode.MainView;
                    StopMemoPlaying();
                    e.Cancel = true;
                    break;

                default:
                    break;
            }
        }
 private void OnStopClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     StopMemoRecording();
 }
Beispiel #9
0
 private void OnStopClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     StopMemoRecording();
 }
        private void OnBeginPlayerStoryboardCompleted(object sender, EventArgs e)
        {
            _mode = MainPageMode.MemoPlaying;

            _memoPlayerViewModel.Play();
            EnableApplicationBar();
        }
        private void OnPlayCompleted()
        {
            _mode = MainPageMode.MainView;

            _memoPlayerViewModel.Stop();
            StopPlayerStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);
        }
 private void OnDeleteClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     _memoPlayerViewModel.Remove();
     StopMemoPlaying();
 }
Beispiel #13
0
 private void OnRecorderInitialized()
 {
     _mode = MainPageMode.MemoRecording;
     EnableApplicationBar();
 }
Beispiel #14
0
 public TermsPageViewModel(MainPageMode mainPageMode, ScrollView termsScrollView)
 {
     _mainPageMode    = mainPageMode;
     _termsScrollView = termsScrollView;
     AcceptCommand    = new AsyncDelegateCommand(OnAccept);
 }
Beispiel #15
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            _mode = MainPageMode.MainView;

            this.ApplicationBar = new ApplicationBar();
            this.ApplicationBar.IsMenuEnabled   = true;
            this.ApplicationBar.IsVisible       = true;
            this.ApplicationBar.Opacity         = 1.0;
            this.ApplicationBar.ForegroundColor = Colors.White;
            this.ApplicationBar.BackgroundColor = Color.FromArgb(255, 0, 0, 140);

            _memoAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Memo.png", UriKind.Relative));
            _memoAppbarIconButton.Text   = AppResources.MemoAppbarText;
            _memoAppbarIconButton.Click += new EventHandler(OnMemoClick);

            _alarmAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Alarm.png", UriKind.Relative));
            _alarmAppbarIconButton.Text   = AppResources.AlarmAppbarText;
            _alarmAppbarIconButton.Click += new EventHandler(OnAlarmClick);

            _anniversaryAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Anniversary.png", UriKind.Relative));
            _anniversaryAppbarIconButton.Text   = AppResources.AnniversaryAppbarText;
            _anniversaryAppbarIconButton.Click += new EventHandler(OnAnniversaryClick);

            _aboutAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/About.png", UriKind.Relative));
            _aboutAppbarIconButton.Text   = AppResources.AboutAppbarText;
            _aboutAppbarIconButton.Click += new EventHandler(OnAboutClick);

            _stopAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Stop.png", UriKind.Relative));
            _stopAppbarIconButton.Text   = AppResources.StopAppbarText;
            _stopAppbarIconButton.Click += new EventHandler(OnStopClick);

            _pauseAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Pause.png", UriKind.Relative));
            _pauseAppbarIconButton.Text   = AppResources.PauseAppbarText;
            _pauseAppbarIconButton.Click += new EventHandler(OnPauseClick);

            _resumeAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Play.png", UriKind.Relative));
            _resumeAppbarIconButton.Text   = AppResources.ResumeAppbarText;
            _resumeAppbarIconButton.Click += new EventHandler(OnResumeClick);

            _deleteAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Delete.png", UriKind.Relative));
            _deleteAppbarIconButton.Text   = AppResources.DeleteAppbarText;
            _deleteAppbarIconButton.Click += new EventHandler(OnDeleteClick);

            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);

            _mainViewModel       = new MainViewModel();
            _listbox.ItemsSource = _mainViewModel.Items;

            _calendarMonthView.MonthViewVisibleRowUpdated += OnMonthViewVisibleRowUpdated;
            _calendarMonthView.MonthViewCurrentDayUpdated += OnMonthViewCurrentDayUpdated;

            _calendarPanelViewModel = _calendarPanel.DataContext as CalendarPanelViewModel;
            _calendarPanelViewModel.CurrentDayUpdated += OnCurrentDayUpdated;

            _memoRecorderViewModel = _memoRecorderPanel.DataContext as MemoRecorderViewModel;
            _memoRecorderViewModel.RecorderInitialized += OnRecorderInitialized;
            _memoRecorderPanel.RecordingTimeout        += OnRecordingTimeout;

            _memoPlayerViewModel = _memoPlayerPanel.DataContext as MemoPlayerViewModel;
            _memoPlayerViewModel.PlayCompleted += OnPlayCompleted;

            BeginRecorderStoryboard.Completed += OnBeginRecorderStoryboardCompleted;
            StopRecorderStoryboard.Completed  += OnStopRecorderStoryboardCompleted;
            BeginPlayerStoryboard.Completed   += OnBeginPlayerStoryboardCompleted;
            StopPlayerStoryboard.Completed    += OnStopPlayerStoryboardCompleted;
        }
        private void OnRecordingTimeout()
        {
            _mode = MainPageMode.MainView;

            StopRecorderStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);

            DisableApplicationBar();
        }
 private void OnRecorderInitialized()
 {
     _mode = MainPageMode.MemoRecording;
     EnableApplicationBar();
 }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            _mode = MainPageMode.MainView;

            this.ApplicationBar = new ApplicationBar();
            this.ApplicationBar.IsMenuEnabled = true;
            this.ApplicationBar.IsVisible = true;
            this.ApplicationBar.Opacity = 1.0;
            this.ApplicationBar.ForegroundColor = Colors.White;
            this.ApplicationBar.BackgroundColor = Color.FromArgb(255, 0, 0, 140);

            _memoAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Memo.png", UriKind.Relative));
            _memoAppbarIconButton.Text = AppResources.MemoAppbarText;
            _memoAppbarIconButton.Click += new EventHandler(OnMemoClick);

            _alarmAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Alarm.png", UriKind.Relative));
            _alarmAppbarIconButton.Text = AppResources.AlarmAppbarText;
            _alarmAppbarIconButton.Click += new EventHandler(OnAlarmClick);

            _anniversaryAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Anniversary.png", UriKind.Relative));
            _anniversaryAppbarIconButton.Text = AppResources.AnniversaryAppbarText;
            _anniversaryAppbarIconButton.Click += new EventHandler(OnAnniversaryClick);

            _aboutAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/About.png", UriKind.Relative));
            _aboutAppbarIconButton.Text = AppResources.AboutAppbarText;
            _aboutAppbarIconButton.Click += new EventHandler(OnAboutClick);

            _stopAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Stop.png", UriKind.Relative));
            _stopAppbarIconButton.Text = AppResources.StopAppbarText;
            _stopAppbarIconButton.Click += new EventHandler(OnStopClick);

            _pauseAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Pause.png", UriKind.Relative));
            _pauseAppbarIconButton.Text = AppResources.PauseAppbarText;
            _pauseAppbarIconButton.Click += new EventHandler(OnPauseClick);

            _resumeAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Play.png", UriKind.Relative));
            _resumeAppbarIconButton.Text = AppResources.ResumeAppbarText;
            _resumeAppbarIconButton.Click += new EventHandler(OnResumeClick);

            _deleteAppbarIconButton =
                new ApplicationBarIconButton(new Uri("/Resources/Images/Appbar/Delete.png", UriKind.Relative));
            _deleteAppbarIconButton.Text = AppResources.DeleteAppbarText;
            _deleteAppbarIconButton.Click += new EventHandler(OnDeleteClick);

            this.ApplicationBar.Buttons.Add(_memoAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_alarmAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_anniversaryAppbarIconButton);
            this.ApplicationBar.Buttons.Add(_aboutAppbarIconButton);

            _mainViewModel = new MainViewModel();
            _listbox.ItemsSource = _mainViewModel.Items;

            _calendarMonthView.MonthViewVisibleRowUpdated += OnMonthViewVisibleRowUpdated;
            _calendarMonthView.MonthViewCurrentDayUpdated += OnMonthViewCurrentDayUpdated;

            _calendarPanelViewModel = _calendarPanel.DataContext as CalendarPanelViewModel;
            _calendarPanelViewModel.CurrentDayUpdated += OnCurrentDayUpdated;

            _memoRecorderViewModel = _memoRecorderPanel.DataContext as MemoRecorderViewModel;
            _memoRecorderViewModel.RecorderInitialized += OnRecorderInitialized;
            _memoRecorderPanel.RecordingTimeout += OnRecordingTimeout;

            _memoPlayerViewModel = _memoPlayerPanel.DataContext as MemoPlayerViewModel;
            _memoPlayerViewModel.PlayCompleted += OnPlayCompleted;

            BeginRecorderStoryboard.Completed += OnBeginRecorderStoryboardCompleted;
            StopRecorderStoryboard.Completed += OnStopRecorderStoryboardCompleted;
            BeginPlayerStoryboard.Completed += OnBeginPlayerStoryboardCompleted;
            StopPlayerStoryboard.Completed += OnStopPlayerStoryboardCompleted;
        }
Beispiel #19
0
 public TermsPage(MainPageMode mainPageMode)
 {
     InitializeComponent();
     BindingContext = _vm = new TermsPageViewModel(mainPageMode, scroll1);
 }