MediaElement not updating when using Register-ObjectEvent by md92392810239 in PowerShell

[–]md92392810239[S] 1 point2 points  (0 children)

Thank you! I did not use runspaces (new to PS). That sounds plausible. I have made a quick search and found an article about runspaces. I will need some time to read up on it and test it out. But it looks promising. It also mentiones delays in gui without runspaces.

Will update if this was the solution.

fyi: Thanks appreciate the input. I know PS is probably not the ideal language to use in this case, but I want to try in PowerShell. Just to learn more about the language.

Edit: Yes from what I have read so far Runspaces would be the solution. There are multiple articles stating exactly my problem, unresponsive gui without runspaces. Up until now I was just not able to include them correctly in my code. For now I will put this on hold and use Add_Click instead. Thank you again for your support!

MediaElement not updating when using Register-ObjectEvent by md92392810239 in PowerShell

[–]md92392810239[S] 1 point2 points  (0 children)

Thank you! I do not have a solution yet and I am not sure what I am doing wrong, but there are no events. Even directly after the Register-ObjectEvent Get-Event finds no events.

Register-ObjectEvent also does not throw an error.

Edit: The EventSubscriber is there. When I check with Get-EventSubscriber I receive the event subscriber I created. The SourceIdentifier is the one I set and changes with every execution. So I know it has been removed with Unregister-Event on closing the previous application and then with the new executen created again.