How do I wait for properties like color changes in WPF?
morde last edited by user
I want to check, whether a background that was grey turned into black. Usually I wait for changes of attributes like this:
Aliases.MyApp.BtnCalculationType.WaitProperty("Enabled", "True", 9999999);
Aliases.MyApp.BtnCalculationType.WaitProperty("Fill.Color.B", "0", 9999999);
does not work. What to do instead?
Fill.Color.Bproperty value is a number, not a string, so you need to remove quotes around 0:
Aliases.MyApp.BtnCalculationType.WaitProperty("Fill.Color.B", 0, 9999999)
Fill.Color.Bis the color's blue component. You may need to also check the red, green and alpha components. To do this, you need to use a custom comparison instead of
WaitPropertydoesn't support checking multiple properties at once). For example:
// JScript var btn = Aliases.MyApp.BtnCalculationType; while ((btn.Fill.Color.B != 0) || (btn.Fill.Color.R != 0) || (btn.Fill.Color.G != 0)) Delay(500);