PS C:\>

Unleash your script

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework.

Use MahApps.metro built-in dialogs

Apply beautiful modal dialog into your project.

How to apply a theme on your GUI?

Some tips on how to apply a theme on your GUI ...

Showing posts with label ProgressBar. Show all posts
Showing posts with label ProgressBar. Show all posts

Tuesday, 29 December 2015

Progressbar WPF

Hello everyone,

If you ended up in this page then that means you were looking for those words:
WPF + Powershell + Progressbar and not really satisfied with what you found on the web.

I mean, you began to write your code in powershell, choosed XAML because the render
was more prettier and we can apply very interseting visual theme.

There maybe another clean way to do this but after many hours of search on
the internet, I haven't found anything that was satisfying me.

So I come up with the idea to create my own, and in my great surprise, it worked. :)


So let's skip all the comment and go to the main subject:
The Problem is:
--> The progressbar won't refresh no matter what. That's normal because powershell handles one process at a time. It waits that one task is finished before starting another one. It means that you cannot update you form unless your process is finished.
--> So what what we need to do is to create another process (a runspace to be more precise) to launch our progressbar.





In this example :

- The main process handles our progressing stuff (a loop from 0 to 100 here, nothing really extraordinary)
- The runspace (launch a modal window which contains our Progressbar and some Label)




    

Share:

Popular Posts

Join us on Facebook

STATS

Contact Form

Name

Email *

Message *

image
Hello,

Thank you for visiting my blog and reading this far.

I'm mainly focusing on scripting, software development and modern workpalce experiences with Microsoft Technology. I created this blog for the main purpose of sharing my knowledge. Hope you will appreciate my works and will help you in yours. You are friendly invited to leave any kind of feedback in the comment sections of my posts.

Please note that all posts on this blog are my own opinions and are provided "as is", without warranty of any kind.