I am wondering: what is the best instruction in terms of performance between these two versions:
Background = Application.Current.Resources[condition ? BackgroundName1 : BackgroundName2] as Brush;
and
Background = condition ? Application.Current.Resources[BackgroundName1] as Brush : Application.Current.Resources[BackgroundName2] as Brush;
Is there any difference? and if so, which is better?
thank
NB: BackgroundName1 and 2 are just strings
David source
share