You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constintDURATION_MS=500;//Change the value if needed
129
-
129
+
intANIMATION_FPS=60;
130
130
if(parentDictionary==null)
131
131
parentDictionary=Application.Current.Resources;
132
132
133
133
if(parentDictionary.Contains(entryName))
134
134
{
135
-
if(animate)//Fade animation is enabled
135
+
if(animate&parentDictionary[entryName]!=null)//Fade animation is enabled and value is not null.
136
136
{
137
137
try
138
138
{
139
139
ColorAnimationanimation=newColorAnimation()
140
140
{
141
-
From=(Color)parentDictionary[entryName],//The old color
142
-
To=(Color)newValue,//The new color
141
+
From=((SolidColorBrush)parentDictionary[entryName]).Color,//The old color
142
+
To=((SolidColorBrush)newValue).Color,//The new color
143
143
Duration=newDuration(newTimeSpan(0,0,0,0,DURATION_MS))//Set the duration
144
144
};
145
-
parentDictionary[entryName]=parentDictionary[entryName]==null?newSolidColorBrush():parentDictionary[entryName];//Set the resource as a new SolidColorBrush if null.
146
145
(parentDictionary[entryName]asSolidColorBrush).BeginAnimation(SolidColorBrush.ColorProperty,animation);//Begin the animation
0 commit comments