Can you animate a custom dependency property in Silverlight? -
i might missing obvious. i'm trying write custom panel contents laid out according couple of dependency properties (i'm assuming have dps because want able animate them.)
however, when try run storyboard animate both of these properties, silverlight throws catastophic error. if try animate 1 of them, works fine. , if try animate 1 of properties , 'built-in' property (like opacity) works. if try animate both custom properties catastrophic error.
anyone else come across this?
edit:
the 2 dps scalex , scaley - both doubles. scale x , y position of children in panel. here's how 1 of them defined:
public double scalex { { return (double)getvalue(scalexproperty); } set { setvalue(scalexproperty, value); } } /// <summary> /// identifies scalex dependency property. /// </summary> public static readonly dependencyproperty scalexproperty = dependencyproperty.register( "scalex", typeof(double), typeof(mypanel), new propertymetadata(onscalexpropertychanged)); /// <summary> /// scalexproperty property changed handler. /// </summary> /// <param name="d">mypanel changed scalex.</param> /// <param name="e">dependencypropertychangedeventargs.</param> private static void onscalexpropertychanged(dependencyobject d, dependencypropertychangedeventargs e) { mypanel _mypanel = d mypanel; if (_mypanel != null) { _mypanel.invalidatearrange(); } } public static void setscalex(dependencyobject obj, double val) { obj.setvalue(scalexproperty, val); } public static double getscalex(dependencyobject obj) { return (double)obj.getvalue(scalexproperty); }
edit: i've tried , without call invalidatearrange (which absolutely necessary in case) , result same. event handler doesn't called before catastrophic error kicks off.
it's documented bug silverlight 2 beta 2. can't animate 2 custom dependancy properties on same object.
Comments
Post a Comment