wpf - Changing mouseover effect on Mahapps Tile -
so i've started using mahapps.metro application. it's been going great, 1 problem cannot solve mouseover effect on tile.
i have grid, in there's expander hosts tiles each of represent connection specific database. bound observablecollection populate database.
<grid> <expander margin="5" header="server connections"> <listbox itemssource="{binding omsconnections}" scrollviewer.horizontalscrollbarvisibility="disabled"> <listbox.itemspanel> <itemspaneltemplate> <wrappanel isitemshost="true" /> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <controls:tile title="{binding name}" controls:controlshelper.mouseoverborderbrush="{dynamicresource blackbrush}" background="{dynamicresource graybrush2}" command="{binding datacontext.tileclickcommand, relativesource={relativesource ancestortype=listbox}}" commandparameter="{binding}" horizontaltitlealignment="left" style="{staticresource largetilestyle}" tiltfactor="2"> <image width="60" height="60" source="{binding omsconnectiontypeid, converter={staticresource connectiontypetoiconconverter}}" /> </controls:tile> </datatemplate> </listbox.itemtemplate> </listbox> </expander> </grid>
this style applied via style
<style x:key="largetilestyle" targettype="controls:tile"> <setter property="height" value="125" /> <setter property="titlefontsize" value="14" /> <setter property="textoptions.textformattingmode" value="display" /> <setter property="textoptions.textrenderingmode" value="cleartype" /> <setter property="width" value="210" /> </style>
so whenever mouseover item black border specified, , orange background color (which, if i'm not mistaken, accentcolorbrush3) , have no idea how change it.
here's image, since rep low , cannot embed it.
also, i'm really, bad templates , styles, pretty scrapped internet. feedback appreciated both way bound collection , how change mouseover color.
you "override" accentcolorbrush3
resource adding solidcolorbrush
resource listbox
:
<listbox itemssource="{binding omsconnections}" scrollviewer.horizontalscrollbarvisibility="disabled"> <!-- specify highlight brush here: --> <listbox.resources> <solidcolorbrush x:key="accentcolorbrush3" color="yellow" /> </listbox.resources> <listbox.itemspanel> <itemspaneltemplate> <wrappanel isitemshost="true" /> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <controls:tile title="{binding name}" controls:controlshelper.mouseoverborderbrush="{dynamicresource blackbrush}" background="{dynamicresource graybrush2}" command="{binding datacontext.tileclickcommand, relativesource={relativesource ancestortype=listbox}}" commandparameter="{binding}" horizontaltitlealignment="left" style="{staticresource largetilestyle}" tiltfactor="2"> <image width="60" height="60" source="{binding omsconnectiontypeid, converter={staticresource connectiontypetoiconconverter}}" /> </controls:tile> </datatemplate> </listbox.itemtemplate> </listbox>
Comments
Post a Comment