SurfaceListBox light background, cannot get rid of it
hello,
did manage create transparent background surfacelistbox ?
no background or borderbrush, neither overrides in templates (also generated ones) seem work.
in blend transparent, @ runtime light whiteish halo there...
thank you
stefano
.: stefano baraldi, ph.d. sb@tabulatouch.eu tabulatouch.eu onthetabletop.eu
hello,
did manage create transparent background surfacelistbox ?
no background or borderbrush, neither overrides in templates (also generated ones) seem work.in blend transparent, @ runtime light whiteish halo there...
thank you
stefano
.: stefano baraldi, ph.d. sb@tabulatouch.eu tabulatouch.eu onthetabletop.eu
found it.
it hard find problem lies surfacelistboxscrollviewerstyle.
i edited copy of template of surfacelistbox.
relies lot of other templates.
extracted template , changed has no background @ all.
or change template (i left away stuff, because otherwise message long, can retrieve left out stuf doing copy of template yourself):
<!-- ... --> <style x:key="surfacelistboxscrollviewerstyle" targettype="{x:type s:surfacescrollviewer}" basedon="{staticresource surfacescrollviewerstyle}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type s:surfacescrollviewer}"> <grid background="{x:null}" <-------------------------- changed value x:null horizontalalignment="stretch" margin="{templatebinding borderthickness}" verticalalignment="stretch" snapstodevicepixels="{templatebinding snapstodevicepixels}"> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="auto"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="auto"/> </grid.rowdefinitions> <border x:name="part_elasticborder" snapstodevicepixels="{templatebinding snapstodevicepixels}" borderbrush="transparent" background="{templatebinding background}"> <scrollcontentpresenter margin="{templatebinding padding}" content="{templatebinding content}" contenttemplate="{templatebinding contenttemplate}" cancontentscroll="{templatebinding cancontentscroll}" canhorizontallyscroll="false" canverticallyscroll="false" grid.columnspan="1" grid.rowspan="1" snapstodevicepixels="{templatebinding snapstodevicepixels}"/> </border> <s:surfacescrollbar visibility="{templatebinding computedhorizontalscrollbarvisibility}" x:name="part_horizontalscrollbar" grid.row="1" orientation="horizontal" viewportsize="{templatebinding viewportwidth}" maximum="{templatebinding scrollablewidth}" minimum="0" background="{templatebinding background}" value="{binding horizontaloffset, mode=oneway, relativesource={relativesource templatedparent}}" automationproperties.automationid="horizontalscrollbar" height="auto" style="{staticresource surfacescrollbarstyle}" largechange="1" cliptobounds="true" snapstodevicepixels="{templatebinding snapstodevicepixels}" /> <s:surfacescrollbar visibility="{templatebinding computedverticalscrollbarvisibility}" x:name="part_verticalscrollbar" grid.column="1" grid.row="0" orientation="vertical" viewportsize="{templatebinding viewportheight}" maximum="{templatebinding scrollableheight}" minimum="0" background="{templatebinding background}" value="{binding verticaloffset, mode=oneway, relativesource={relativesource templatedparent}}" automationproperties.automationid="verticalscrollbar" width="auto" style="{staticresource surfacescrollbarstyle}" largechange="1" cliptobounds="true" snapstodevicepixels="{templatebinding snapstodevicepixels}"/> <border x:name="container" grid.column="1" grid.row="1" snapstodevicepixels="{templatebinding snapstodevicepixels}" borderbrush="transparent" background="{templatebinding background}"/> </grid> <controltemplate.triggers> <trigger property="isenabled" value="false"> <setter property="isenabled" targetname="part_horizontalscrollbar" value="false"/> <setter property="isenabled" targetname="part_verticalscrollbar" value="false"/> <setter property="borderbrush" targetname="part_elasticborder" value="{dynamicresource {x:static s:surfacecolors.controlborderdisabledbrushkey}}"/> </trigger> </controltemplate.triggers> </controltemplate> </setter.value> </setter> </style> <style x:key="surfacelistboxstyle1" targettype="{x:type s:surfacelistbox}" basedon="{staticresource controlbasestyle}"> <setter property="background" value="{staticresource controlhitareabrush}" /> <setter property="scrollviewer.horizontalscrollbarvisibility" value="auto" /> <setter property="scrollviewer.verticalscrollbarvisibility" value="auto" /> <setter property="scrollviewer.cancontentscroll" value="false" /> <setter property="s:surfacescrollviewer.elasticity" value="0,0.4" /> <setter property="minheight" value="80" /> <setter property="foreground" value="{dynamicresource {x:static s:surfacecolors.buttonforegroundbrushkey}}"/> <setter property="borderbrush" value="{dynamicresource {x:static s:surfacecolors.listboxborderbrushkey}}"/> <setter property="padding" value="0" /> <setter property="borderthickness" value="2" /> <setter property="margin" value="0" /> <setter property="template"> <setter.value> <controltemplate targettype="{x:type s:surfacelistbox}"> <grid snapstodevicepixels="{templatebinding snapstodevicepixels}" > <s:surfacescrollviewer style="{staticresource surfacelistboxscrollviewerstyle}" horizontalscrollbarvisibility="{templatebinding scrollviewer.horizontalscrollbarvisibility}" verticalscrollbarvisibility="{templatebinding scrollviewer.verticalscrollbarvisibility}" focusable="false" background="{templatebinding background}" foreground="{templatebinding foreground}" width="auto" height="auto" minheight="{templatebinding minheight}" minwidth="{templatebinding minwidth}" x:name="scrollviewer" elasticity="{templatebinding s:surfacescrollviewer.elasticity}"> <itemspresenter cliptobounds="false" minheight="{templatebinding minheight}" minwidth="{templatebinding minwidth}"/> </s:surfacescrollviewer> <border x:name="border" borderbrush="{templatebinding borderbrush}" borderthickness="{templatebinding borderthickness}" /> </grid> <controltemplate.triggers> <trigger property="isgrouping" value="true"> <setter property="scrollviewer.cancontentscroll" value="false" /> </trigger> </controltemplate.triggers> </controltemplate> </setter.value> </setter> </style>
or change the value s:surfacecolors.listboxbackgroundbrushkey transparent doing this:
<s:surfacewindow.resources> <solidcolorbrush x:key="{x:static s:surfacecolors.listboxbackgroundbrushkey}" color="transparent" /> </s:surfacewindow.resources>
s:surfacecolors.listboxbackgroundbrushkey color responsable background.
Other Forums > Surface Application Design and Development
Comments
Post a Comment