c# - WPF : control visibility does not render in a command after the first time -
working on mvvm wpf form.
i'm using relaycommand to:
1) change control visibility
2) run long process
3) update control's visibility back
command code follows:
private relaycommand _mycommand; public relaycommand mycommand { { return _mycommand ?? (_mycommand = new relaycommand( () => { //1 update control's visibility gridviewvisibility = false; //deleting reference done via multithreading process quite long (10 sec) task.run(() => { application.current.dispatcher.invoke((new action(() => { //2 looong process here //3 update control's visibility gridviewvisibility = true; } ))); } ); } )); } }
systematically, when run command first time, works perfectly. controls visibility updates expected (before , after process).
but when trigger command again, operation 2 still performed. code updates visibility reached not render (1 , 3). control's visibility not updated.
any idea why????
Comments
Post a Comment