windows phone 7 - How to make multiple buttons with different backgrounds from one template in Expression Blend 4 -


i made simple button template rectangle "make control../button" command. now, need several buttons template each button must have different background image. tried in blend4 when change button background, button holds template background (or none, whichever set in template), ignoring image have set specific button. button template:

btnmenu (no brush)     -rectangle (no brush)     -[contentpresenter] (some text) 

i apreciate advice.

style:

<style x:key="btnstylemenuhome" targettype="button">             <setter property="template">                 <setter.value>                     <controltemplate targettype="button">                         <grid x:name="btnmenu" width="90" height="70" margin="0" verticalalignment="center" horizontalalignment="center">                             <grid.background>                                 <imagebrush stretch="none"/>                             </grid.background>                             <visualstatemanager.visualstategroups>                                 <visualstategroup x:name="commonstates">                                     <visualstate x:name="normal"/>                                     <visualstate x:name="mouseover"/>                                     <visualstate x:name="pressed">                                         <storyboard>                                             <objectanimationusingkeyframes storyboard.targetproperty="(shape.fill).(tilebrush.stretch)" storyboard.targetname="rectangle">                                                 <discreteobjectkeyframe keytime="0">                                                     <discreteobjectkeyframe.value>                                                         <stretch>uniform</stretch>                                                     </discreteobjectkeyframe.value>                                                 </discreteobjectkeyframe>                                             </objectanimationusingkeyframes>                                         </storyboard>                                     </visualstate>                                     <visualstate x:name="disabled"/>                                 </visualstategroup>                             </visualstatemanager.visualstategroups>                             <rectangle x:name="rectangle" radiusy="5" radiusx="5" strokethickness="0" width="90" height="70" verticalalignment="center" horizontalalignment="center">                                 <rectangle.fill>                                     <imagebrush stretch="none" imagesource="images/someimage.png"/>                                 </rectangle.fill>                             </rectangle>                             <contentpresenter verticalalignment="bottom" margin="7,0" d:layoutoverrides="width" height="25" horizontalalignment="center"/>                         </grid>                     </controltemplate>                 </setter.value>             </setter>             <setter property="background">                 <setter.value>                     <imagebrush stretch="none"/>                 </setter.value>             </setter>         </style> 

have @ custom usercontrol property used child element


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -