How could i make a "blink" animation based on a bool value?
I have a panel with 3 objectstaht want to animate, and tried to use this code in the panel inizialization where they are:
Code: Select all
void EP_BlinkCB(string dp1, bool newValue)
{
if(newValue==1)
{
bool oldValueCerrado=cerrado.visible;
bool oldValueAbierto=abierto.visible;
bool oldValueIndefinido=indefinido.visible;
int blinkTime=500;
while(newValue)
{
cerrado.visible=false;
abierto.visible=false;
indefinido.visible=false;
delay(0,blinkTime);
cerrado.visible=true;
abierto.visible=true;
indefinido.visible=true;
delay(0,blinkTime);
}
cerrado.visible=oldValueCerrado;
abierto.visible=oldValueAbierto;
indefinido.visible=oldValueIndefinido;
}
}also, because i use delay, if there are different panels each one blinks at a diferent moment, How could i sonchronize them?
I thought of using dinamic colors but the objects are icons so i need to use the visibiliy property.
¿there is no easy way to make this animation?
Thank you very much