i'm trying add sort of animation items they're added listbox, blog purports link
the trouble is, when add visualstategroup beforeloaded , loaded state names, items fail render @ in listbox. blue highlighting when hover, , brighter blue when click select, actual content of listbox item (the random rectangle) absent.
when remove group, rectangles render perfectly, without sort of animation (obviously). attached complete style itemcontainerstyle of listbox. rest of code verbatim link.
<style x:key="listboxitemstyle1" targettype="listboxitem"> <setter property="padding" value="3"/> <setter property="horizontalcontentalignment" value="left"/> <setter property="verticalcontentalignment" value="top"/> <setter property="background" value="transparent"/> <setter property="borderthickness" value="1"/> <setter property="tabnavigation" value="local"/> <setter property="template"> <setter.value> <controltemplate targettype="listboxitem"> <grid background="{templatebinding background}"> <visualstatemanager.visualstategroups> <visualstategroup x:name="layoutstates"> <visualstate x:name="beforeloaded"> <storyboard> <doubleanimation duration="00:00:00" by="-196" storyboard.targetname="contentprojection" storyboard.targetproperty="globaloffsetx" /> <doubleanimation duration="00:00:00" by="-180" storyboard.targetname="contentprojection" storyboard.targetproperty="rotationy" /> <doubleanimation duration="00:00:00" by="-270" storyboard.targetname="contentprojection" storyboard.targetproperty="rotationx" /> </storyboard> </visualstate> <visualstate x:name="loaded"> <storyboard> <doubleanimation duration="00:00:01" to="0" storyboard.targetname="contentprojection" storyboard.targetproperty="globaloffsetx" /> <doubleanimation duration="00:00:01" to="0" storyboard.targetname="contentprojection" storyboard.targetproperty="rotationy" /> <doubleanimation duration="00:00:01" to="0" storyboard.targetname="contentprojection" storyboard.targetproperty="rotationx" /> </storyboard> </visualstate> <visualstate x:name="unloaded" /> </visualstategroup> <visualstategroup x:name="commonstates"> <visualstate x:name="normal" /> <visualstate x:name="mouseover"> <storyboard> <doubleanimation duration="0" to=".35" storyboard.targetproperty="opacity" storyboard.targetname="fillcolor"/> </storyboard> </visualstate> <visualstate x:name="disabled"> <storyboard> <doubleanimation duration="0" to=".55" storyboard.targetproperty="opacity" storyboard.targetname="contentpresenter"/> </storyboard> </visualstate> </visualstategroup> <visualstategroup x:name="selectionstates"> <visualstate x:name="unselected"/> <visualstate x:name="selected"> <storyboard> <doubleanimation duration="0" to=".75" storyboard.targetproperty="opacity" storyboard.targetname="fillcolor2"/> </storyboard> </visualstate> </visualstategroup> <visualstategroup x:name="focusstates"> <visualstate x:name="focused"> <storyboard> <objectanimationusingkeyframes duration="0" storyboard.targetproperty="visibility" storyboard.targetname="focusvisualelement"> <discreteobjectkeyframe keytime="0"> <discreteobjectkeyframe.value> <visibility>visible</visibility> </discreteobjectkeyframe.value> </discreteobjectkeyframe> </objectanimationusingkeyframes> </storyboard> </visualstate> <visualstate x:name="unfocused"/> </visualstategroup> </visualstatemanager.visualstategroups> <rectangle x:name="fillcolor" fill="#ffbadde9" ishittestvisible="false" opacity="0" radiusy="1" radiusx="1"/> <rectangle x:name="fillcolor2" fill="#ffbadde9" ishittestvisible="false" opacity="0" radiusy="1" radiusx="1"/> <!--<contentpresenter x:name="contentpresenter" content="{templatebinding content}" contenttemplate="{templatebinding contenttemplate}" horizontalalignment="{templatebinding horizontalcontentalignment}" margin="{templatebinding padding}"/>--> <contentpresenter x:name="contentpresenter" content="{templatebinding content}" contenttemplate="{templatebinding contenttemplate}" horizontalalignment="{templatebinding horizontalcontentalignment}" margin="{templatebinding padding}"> <contentpresenter.projection> <planeprojection x:name="contentprojection"> </planeprojection> </contentpresenter.projection> </contentpresenter> <rectangle x:name="focusvisualelement" radiusy="1" radiusx="1" stroke="#ff6dbdd1" strokethickness="1" visibility="collapsed"/> </grid> </controltemplate> </setter.value> </setter> </style>
one of problems following code in blogs many blogs explaining exciting new features written against ctp , beta versions. result cease work verbatim against rtm versions.
in case state (and mike) calling "loaded" infact called "afterloaded".
Comments
Post a Comment