简体   繁体   中英

UWP programmatically remove visualstate for specific listviewitem

My style is defined for the listview. Listview items will have focus behaviour.

I have 3 types in my ListView. One is unselectable and will also not having focus behaviour (used property IsHitTestVisible = false ) One is selectable, can have focus colors (works correctly) One should be selectable but only should not having a focus state.

IsEnabled changes the transparancy and is unselectable so no option. IsHitTestVisible doesnt change the transparancy but make the item also unclickable.

Do anyone have an example how I can remove only the focus behaviour but keep the rest for a specific item?

You can create a ViewCellRenderer for your listview. For Reference you can use this link:

http://blog.wislon.io/posts/2017/04/11/xamforms-listview-selected-colour

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM