In order to get around this, we can create a custom class, create a synchrnoized hashtable, and then put the class in the synchrnoized hash table. In plain English, you can really only use Power Shell classes to get information from the user, not display information to them after doing some work.
With this combination, we can now modify bound properties of the WPF UI in a separate thread without having to do magic in the UI thread! Because of this limitation, I only use C# classes, and I’m going to show you how to easily create a C# class!
Window Title is also going to be a string, so I want to make it a string. This gets the value I’m sending it, and sets the property to the value. If I simply put in get and set, I’m going to update the variable, but will not tell the UI it was updated, so the UI won’t update!Also, you can see that the execution speed of the method which limits the rate of the events.In this case the GUI is perfectly responsive and the Task execution speed is better but still low.When we called Notify Property Changed, we passed the name of the property changing (in this case, Window Title).Looking at the code, we are saying if the parameter property is not null, it is going to raise the event Property Changed: And that’s it! If I want to add a second property of an unknown type (so it can be anything), it’s pretty easy.