c# - UI refresh looping a Dispatcher.BeginInvoke -


i'm trying system.windows.shapes.rectangle rotation in y axis simulating card rotation, showing route.

the problem ui refreshes @ end.

simplified version of code

call of method

for (i=0; i<=180; i++) {     int j = i;     dispatcher.begininvoke(new a_dispatcher(() => {             print_animation_of_card(card, i);         }),          null); } 

method

private void print_animation_of_card(system.windows.shapes.rectangle card) {     ...     system.windows.media.planeprojection p =          card.projection system.windows.media.planeprojection;     p.rotationy = i;     card.projection = p; } 

i have tried put method, same result...

how can show rotation movement of system.windows.shapes.rectangle?

i believe problem using begininvoke() instead of invoke. not wait 1 angle of rotation complete before next 1 called, calls stacked on top of eachother.

try dispatcher.invoke() or put whole loop inside 1 dispatcher.begininvoke() , see if results more satisfaction.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -