Пример #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 = (DownloadPopupContentControl)downloadPrompt.Body;

            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(); };
            dt.Start();
        }
Пример #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.Show();
        }
Пример #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();
        }
Пример #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;
        }