c# - Silder for windows phone 7 -
while using slider windows phone 7 app facing issue make slider in center position. trying balance slider 1 can slide left or right position , center default.
<style x:key="sliderstyle1" targettype="slider"> <setter property="borderthickness" value="0"/> <setter property="borderbrush" value="transparent"/> <setter property="maximum" value="10"/> <setter property="minimum" value="0"/> <setter property="value" value="0"/> <setter property="background" value="{staticresource phonecontrastbackgroundbrush}"/> <setter property="foreground" value="{staticresource phoneaccentbrush}"/> <setter property="template"> <setter.value> <controltemplate targettype="slider"> <grid background="transparent"> <visualstatemanager.visualstategroups> <visualstategroup x:name="commonstates"> <visualstate x:name="normal"/> <visualstate x:name="mouseover"/> <visualstate x:name="disabled"> <storyboard> <doubleanimation duration="0" to="0.1" storyboard.targetproperty="opacity" storyboard.targetname="horizontaltrack"/> <objectanimationusingkeyframes storyboard.targetproperty="fill" storyboard.targetname="horizontalfill"> <discreteobjectkeyframe keytime="0" value="{staticresource phonedisabledbrush}"/> </objectanimationusingkeyframes> </storyboard> </visualstate> </visualstategroup> </visualstatemanager.visualstategroups> <grid x:name="horizontaltemplate" margin="0"> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="0"/> <columndefinition width="*"/> </grid.columndefinitions> <rectangle x:name="horizontaltrack" fill="{templatebinding background}" height="12" ishittestvisible="false" margin="0,22,0,50" opacity="0.2" grid.column="2" radiusy="6" radiusx="6" strokethickness="2" /> <rectangle x:name="horizontalfill" fill="{templatebinding foreground}" height="12" ishittestvisible="false" margin="0,22,0,50" radiusx="6" radiusy="6" rendertransformorigin="0,0"/> <repeatbutton x:name="horizontaltracklargechangedecreaserepeatbutton" grid.column="0" istabstop="false" template="{staticresource phonesimplerepeatbutton}"/> <repeatbutton x:name="horizontaltracklargechangeincreaserepeatbutton" grid.column="1" istabstop="true" template="{staticresource phonesimplerepeatbutton}" horizontalalignment="right"/> <thumb x:name="horizontalthumb" grid.column="1" margin="-1,0,0,30" rendertransformorigin="0.5,0.5" template="{staticresource phonesimplethumb}" width="1" borderthickness="3" background="black" borderbrush="#26000000" > <thumb.foreground> <solidcolorbrush color="#ff1ba1e2"/> </thumb.foreground> <thumb.rendertransform> <scaletransform scaley="1" scalex="32"/> </thumb.rendertransform> </thumb> </grid> </grid> </controltemplate> </setter.value> </setter> </style>
i want give minimum , maximum values considering minimum values negative rather being zero.
**
how can balance slider 1 can slide left or right position , center default providing them horizontal fill on both sides?
**
a control template don't seems solution.
try setting maximum="1" minimum="-1" value="0"
when using slider case
Comments
Post a Comment