c# - How to change Highlight color of the selected ListView item in UWP (Windows 10) -


i'm working on windows 10 app using c# , xaml. have listview , want change default highlight color of selected item. seeing many code examples (like this) designed wp8 or win8, trying implement not work me.

in general i'm having troubles modifying default themes of controls because don't find useful documentation. great if can me highlight color , recommend me documentation.

actually better way discover styling properties use blend.

first, open page in blend. right click on listview , go

edit additional templates > edit generated item container (itemcontainerstyle) > edit copy.

give name , hit ok.

now, have generated full built-in style listviewitems , can find information appearance, animations , other visual behaviors.

you should @ piece of code -

<listviewitempresenter checkbrush="{themeresource systemcontrolforegroundbasemediumhighbrush}"                         contentmargin="{templatebinding padding}"                         checkmode="inline"                         contenttransitions="{templatebinding contenttransitions}"                         checkboxbrush="{themeresource systemcontrolforegroundbasemediumhighbrush}"                         dragforeground="{themeresource listviewitemdragforegroundthemebrush}"                         dragopacity="{themeresource listviewitemdragthemeopacity}"                         dragbackground="{themeresource listviewitemdragbackgroundthemebrush}"                         disabledopacity="{themeresource listviewitemdisabledthemeopacity}"                         focusborderbrush="{themeresource systemcontrolforegroundalthighbrush}"                         focussecondaryborderbrush="{themeresource systemcontrolforegroundbasehighbrush}"                         horizontalcontentalignment="{templatebinding horizontalcontentalignment}"                         pointeroverforeground="{themeresource systemcontrolhighlightaltbasehighbrush}"                        pressedbackground="{themeresource systemcontrolhighlightlistmediumbrush}"                        placeholderbackground="{themeresource listviewitemplaceholderbackgroundthemebrush}"                        pointeroverbackground="{themeresource systemcontrolhighlightlistlowbrush}"                        reorderhintoffset="{themeresource listviewitemreorderhintthemeoffset}"                         selectedpressedbackground="{themeresource systemcontrolhighlightlistaccenthighbrush}"                        selectioncheckmarkvisualenabled="true"                         selectedforeground="{themeresource systemcontrolhighlightaltbasehighbrush}"                        selectedpointeroverbackground="{themeresource systemcontrolhighlightlistaccentmediumbrush}"                         selectedbackground="{themeresource systemcontrolhighlightlistaccentlowbrush}"                        verticalcontentalignment="{templatebinding verticalcontentalignment}" /> 

see line selectedbackground="{themeresource systemcontrolhighlightlistaccentlowbrush}"? that's can apply own color it. keep in mind should of type brush instead of color.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -