Enterwell / Wpf.Notifications

WPF notifications UI controls (as seen in VS Code)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change progressbar value

ghost1372 opened this issue · comments

hi how i can update my progressbar value?
i have this but i cant update value after that.

.WithOverlay(new ProgressBar
               {
                   VerticalAlignment = VerticalAlignment.Bottom,
                   HorizontalAlignment = HorizontalAlignment.Stretch,
                   Height = 3,
                   BorderThickness = new Thickness(0),
                   Foreground = new SolidColorBrush(Color.FromArgb(128, 255, 255, 255)),
                   Background = Brushes.Transparent,
                   IsIndeterminate = false,
                   IsHitTestVisible = false,
                   Value = 25
               })

You would need to instantiate the progress bar prior to message. That way you can access it after you'we created/shown the message.

var progressBar = new ProgressBar
{
     VerticalAlignment = VerticalAlignment.Bottom,
     HorizontalAlignment = HorizontalAlignment.Stretch,
     Height = 3,
     BorderThickness = new Thickness(0),
     Foreground = new SolidColorBrush(Color.FromArgb(128, 255, 255, 255)),
     Background = Brushes.Transparent,
     IsIndeterminate = false,
     IsHitTestVisible = false,
     Value = 25
 };

...

.WithOverlay(progressBar)

...

progressBar.Value = 100

Alternative would be creating custom NotificationMessage and NotificationMessageFactory that has the progress bar as part of the class.

@ghost1372 Did you manage to solve your problem?

@AleksandarDev oh yes tnx for your help