Example #1
0
 /// <summary>
 /// Chama DialogBox síncrono
 /// </summary>
 /// <param name="message">Texto da mensagem</param>
 /// <param name="color">Cor do DialogBox</param>
 public void SyncDialogBox(string message, DialogBoxColor dbgcolor)
 {
     TextDialogBox  = message;
     ColorDialogBox = GetColor(dbgcolor);
     ViewDialogBox  = Visibility.Visible;
     System.Media.SystemSounds.Exclamation.Play();
 }
Example #2
0
        /// <summary>
        /// Pega o cor corresponde ao enum
        /// </summary>
        /// <param name="_cor"></param>
        /// <returns></returns>
        private SolidColorBrush GetColor(DialogBoxColor _cor)
        {
            var _color = Brushes.White;

            switch (_cor)
            {
            case DialogBoxColor.Blue:
                _color = Brushes.CornflowerBlue;
                break;

            case DialogBoxColor.Green:
                _color = Brushes.Green;
                break;

            case DialogBoxColor.Orange:
                _color = Brushes.Orange;
                break;

            case DialogBoxColor.Red:
                _color = Brushes.Red;
                break;
            }

            return(_color);
        }
Example #3
0
 /// <summary>
 /// Chama MessageBox síncrono
 /// </summary>
 /// <param name="message">Texto da mensagem</param>
 /// <param name="color">Cor do DialogBox</param>
 public void SyncMessageBox(string message, DialogBoxColor dbgcolor)
 {
     //StartProgress = true;
     TextMessageBox  = message;
     ColorMessageBox = GetColor(dbgcolor);
     ViewMessageBox  = Visibility.Visible;
     //System.Media.SystemSounds.Exclamation.Play();
     Freezetime(10);
     ViewMessageBox = Visibility.Collapsed;
     //StartProgress = false;
 }
Example #4
0
        /// <summary>
        /// Chama Messagebox assíncrono
        /// </summary>
        /// <param name="message">Texto da mensagem</param>
        /// <param name="dbgcolor">Cor da MessageBox</param>
        public async void AsyncMessageBox(string message, DialogBoxColor dbgcolor, bool _cangoback)
        {
            TextMessageBox  = message;
            ColorMessageBox = GetColor(dbgcolor);
            ViewMessageBox  = Visibility.Visible;
            //StartProgress = true;
            //System.Media.SystemSounds.Exclamation.Play();

            var t = Task.Run(() => Freezetime(10));

            await t;

            if (t.IsCompleted)
            {
                //StartProgress = false;
                ViewMessageBox = Visibility.Collapsed;
                if (_cangoback)
                {
                    GlobalNavigation.NavService.GoBack();
                }
            }
        }