Exemple #1
0
        private void CurrentViewModel_InstallTerminatedEvent(object sender, SimpleMvvmToolkit.NotificationEventArgs <bool> e)
        {
            if (downloadPrompt == null)
            {
                return;
            }

            EasyTracker.GetTracker().SendEvent("ui_action", "download_install_level_terminated", e.Data.ToString(), 0);

            Debug.WriteLine("CurrentViewModel_InstallTerminatedEvent");
            DownloadPopupContentControl control = downloadPrompt.Body as DownloadPopupContentControl;

            if (control == null)
            {
                return;
            }

            if (e.Data == true)
            {
                control.SetTitleText(AppResources.PopupLevelsDownloadTerminatedOk);
            }
            else
            {
                control.SetTitleText(AppResources.PopupLevelsDownloadTerminatedError);
            }

            Debug.WriteLine("Launch Timer");
            DispatcherTimer dt = new DispatcherTimer();

            dt.Interval = TimeSpan.FromSeconds(1.2);
            dt.Tick    += (s, evt) => { downloadPrompt.Hide(); dt.Stop(); downloadPrompt = null; };
            dt.Start();
        }
Exemple #2
0
        private void CurrentViewModel_InstallLevelStartEvent(object sender, SimpleMvvmToolkit.NotificationEventArgs e)
        {
            //downloadPrompt = MessagePromptHelper.GetNewMessagePromptWithNoTitle();
            //downloadPrompt.IsAppBarVisible = false;
            //downloadPrompt.IsCancelVisible = false;
            //downloadPrompt.ActionPopUpButtons.Clear();
            //downloadPrompt.Message = AppResources.PopupLevelsDownloadMessage;
            //downloadPrompt.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
            //downloadPrompt.VerticalContentAlignment = System.Windows.VerticalAlignment.Center;
            //downloadPrompt.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            //downloadPrompt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            //var progressBar = new ProgressBar();
            //progressBar.IsEnabled = true;
            //progressBar.Value = 0;
            //downloadPrompt.Body = progressBar;
            //downloadPrompt.Show();

            Debug.WriteLine("CurrentViewModel_InstallLevelStartEvent");

            // We show the "about" app info
            downloadPrompt = MessagePromptHelper.GetNewMessagePromptWithNoTitleAndWhiteStyle();
            downloadPrompt.VerticalContentAlignment = System.Windows.VerticalAlignment.Center;
            downloadPrompt.VerticalAlignment        = System.Windows.VerticalAlignment.Center;

            var body = new DownloadPopupContentControl();

            body.ProgressBar.Visibility      = System.Windows.Visibility.Visible;
            body.PercentTextblock.Visibility = System.Windows.Visibility.Visible;
            body.SetTitleText(AppResources.PopupLevelsDownloadMessage);
            //  Prompt if sure of reinit
            downloadPrompt.ActionPopUpButtons.Clear();
            downloadPrompt.Body       = body;
            downloadPrompt.Completed += (s, evt) => { this.CurrentViewModel.CancelCurrentDonwloadIfAny(); };
            downloadPrompt.Show();
        }
Exemple #3
0
        private void CurrentViewModel_DownloadProgressEvent(object sender, SimpleMvvmToolkit.NotificationEventArgs <int> e)
        {
            if (downloadPrompt == null)
            {
                return;
            }

            Debug.WriteLine("CurrentViewModel_DownloadProgressEvent");
            DownloadPopupContentControl control = (DownloadPopupContentControl)downloadPrompt.Body;

            control.SetPercentProgress(e.Data);
            //downloadPrompt.Message = e.Data.ToString();
        }
Exemple #4
0
        private void CurrentViewModel_InstallFilesProgress(object sender, SimpleMvvmToolkit.NotificationEventArgs <int> e)
        {
            if (downloadPrompt == null)
            {
                return;
            }

            Debug.WriteLine("CurrentViewModel_InstallFilesProgress");
            DownloadPopupContentControl control = (DownloadPopupContentControl)downloadPrompt.Body;

            control.SetTitleText(AppResources.PopupLevelsDownloadInstallationProgress);
            control.SetPercentProgress(e.Data);
            //control.PercentTextblock.Visibility = System.Windows.Visibility.Collapsed;
            //control.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
        }