edeploy | Linux systems
kandi X-RAY | edeploy Summary
kandi X-RAY | edeploy Summary
Linux systems provisioning and updating made easy
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of edeploy
edeploy Key Features
edeploy Examples and Code Snippets
Community Discussions
Trending Discussions on edeploy
QUESTION
I'm new to both WPF and threading, and this is partly based on code I have not made, so I'm not even able to ask the right questions or know where to look.
I have a application with a toggle button that can stop and start some services.
When you start up the app, the services are running. You can then click the button to stop them. While waiting for the services to stop (or start) the button is disabled. When all services have transitioned from one state to another, the text on the button changes, and the button is supposed to be enabled, except it does not, the text is being changed, but the button does not become enabled. However, if I click anywhere on the GUI, the button becomes enabled. And this leads me to think that the clicking somehow (re)acivates a thread.
Comments to the code
In the constructor, I refer to the method CanServicesExecute() whether the button is enabled or not. So while the program is running this method is being hit all the time by the system.
The part that checks if the services are running is done by a separate thread in order not the block the rest of the GUI, but only disabling the one button. It checks every 5 sec.
In this code I have substituted the actual checking if services have terminated or stopped with a simple wait, but my problem remains: After the Thread.Sleep, the Servicesstate is being set, and the button IS getting another text, but the CanServicesExecute() is no longer being hit. Until I click somewhere in the GUI, and then it is being hit constantly again.
...ANSWER
Answered 2021-Jan-19 at 21:47You need to make sure that CanServicesExecute
is called whenever you want to refresh the status of the Button
that is bound to the StopStartServicesCommand
. You do this by raising the command's CanExecuteChanged
event.
How to raise the event depends on the implementation of the RelayCommand
class that you are using. It should have a public method that raises the event:
QUESTION
I created the default Angular app using the CLI like so:
...ANSWER
Answered 2018-Mar-04 at 08:51Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install edeploy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page