c# - How can I create Translate storyboard animation programmatically UWP? -
i create dynamic translate y animations grids, can't find how in uwp programmatically.
i have code, says
winrt information: cannot resolve targetproperty translatey on specified object.
i have tried set property name y, says:
winrt information: cannot resolve targetproperty y on specified object.
sample:
private void createstoryboardanimation(grid mygrid) { mygrid.rendertransform = new compositetransform(); storyboard storyboard = new storyboard(); doubleanimation translateyanimation = new doubleanimation(); translateyanimation.from = -500; translateyanimation.to = 1; translateyanimation.duration = new duration(timespan.frommilliseconds(500)); storyboard.settarget(translateyanimation, mygrid); storyboard.settargetproperty(translateyanimation, "translatey"); storyboard.children.add(translateyanimation); storyboard.begin(); }
i have tried use translatetransform class... don't how use it.
storyboard.settargetproperty accepts string in uwp.
i move grid on screen animation. know how make storyboard animation in blend, not option in case.
your code totally true use line :
storyboard.settargetproperty(translateyanimation, "(uielement.rendertransform).(compositetransform.translatey)");
instead of
storyboard.settargetproperty(translateyanimation, "translatey");
that's . have great day :)
Comments
Post a Comment