xaml - VisualState Storyboard.TargetName in UWP -


i'm new working visualstates , wondered how set storyboard.targetname control being styled ?

i hope following snippet make question little clearer.

<style x:key="appbarbtnstyle" targettype="appbarbutton">      <setter property="borderbrush" value="gray"/>     <setter property="template">         <setter.value>             <controltemplate targettype="appbarbutton"> <grid x:name="root"  <visualstatemanager.visualstategroups>                             <visualstategroup x:name="commonstates">                                 <visualstate x:name="flash">                                     <storyboard>                                         <coloranimationusingkeyframes storyboard.targetname="what goes here target borderbrush set above" storyboard.targetproperty="(borderbrush).(solidcolorbrush.color)"  duration="0:0:1"> 

how set storyboard.targetname control being styled ?

it seems want animate <setter> property borderbrush. when style used define control template, targettype of style element , targettype of controltemplate element control.template setter should use same value.details please reference styles , templates section of setter class.

for example, borderbrush property can find in grid control named root inside appbarbutton styles , templates.

<grid     x:name="root"     minwidth="{templatebinding minwidth}"     maxwidth="{templatebinding maxwidth}"     background="{templatebinding background}"     borderbrush="{templatebinding borderbrush}"     borderthickness="{templatebinding borderthickness}"> 

so can met requierements setting storyboard.targetname root element color animation here.

<visualstate x:name="normal">     <storyboard>         <coloranimationusingkeyframes             storyboard.targetname="root"             storyboard.targetproperty="(background).(solidcolorbrush.color)"             duration="0:0:5">             <linearcolorkeyframe keytime="00:00:02" value="blue" />             <discretecolorkeyframe keytime="00:00:2.5" value="yellow" />         </coloranimationusingkeyframes>         <pointerupthemeanimation storyboard.targetname="overflowtextlabel" />     </storyboard> </visualstate> 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -