示例#1
0
 public ProgressNotificationId StartProgress(String messageFormat, params Object[] args)
 {
     lock (ProgressNotificationSync)
     {
         var update = new ProgressNotificationUpdate()
         {
             IsVisible = true, IsIndeterminate = false, Message = String.Format(messageFormat, args), Value = 0
         };
         Updates.Add(update);
         OnProgressNotificationUpdated(update);
         return(update.Id);
     }
 }
示例#2
0
 public ProgressNotificationId ShowProgress(String message)
 {
     lock (ProgressNotificationSync)
     {
         var update = new ProgressNotificationUpdate()
         {
             IsVisible = true, IsIndeterminate = true, Message = message, Value = null
         };
         Updates.Add(update);
         OnProgressNotificationUpdated(update);
         return(update.Id);
     }
 }
示例#3
0
        public async Task ShowProgressMessageAsync(String message)
        {
            var update = new ProgressNotificationUpdate()
            {
                IsVisible = true, IsIndeterminate = false, Message = message, Value = null
            };

            lock (ProgressNotificationSync)
            {
                Updates.Add(update);
                OnProgressNotificationUpdated(update);
            }
            await Task.Delay(2000);

            HideProgress(update.Id);
        }
示例#4
0
 private void OnProgressNotificationUpdated(ProgressNotificationUpdate value)
 {
     ProgressNotification = value;
     ProgressNotificationUpdated(this, value);
 }