c# - How to make command not disable button when clicked -


i'm developping application in mvvm. i'm using buttons relaycommand perform action. fact that, relaycommand, button disabled when clicked on it, time command executing. because our rendering engine little bit heavy, when open new window, button stay disabled bit, second.

my question : there way disable behaviour , let button enabled, because changes style ? changing disabled style not option ...

i haven't see kind of behavior on net or in documentation ?

thank

edit :

two differents implementations of relaycommand

        answercommand = new relaycommand(p => answermail(p), p => ismailselected());         deletemailcommand = new relaycommand(p => task.run(() => deletemail()), p => ismailselected()); 

i think should synchronize access block existing in icommand instance execute method , every time there, start new thread. if want click on button many times, having lock section there, put calls in queue. if want reject requests received while it's still working can implement balking pattern.

https://en.wikipedia.org/wiki/balking_pattern

this way, button stop being disabled when created thread starting.

i not sure if approach helps think it's feasible scenario.

one more thing, i've found this:

patterns asynchronous mvvm applications: commands

i haven't used before looks nice, give try tonight. luck!


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -