简体   繁体   English

UWP以编程方式删除特定listviewitem的视觉状态

[英]UWP programmatically remove visualstate for specific listviewitem

My style is defined for the listview. 我的样式是为listview定义的。 Listview items will have focus behaviour. Listview项目将具有焦点行为。

I have 3 types in my ListView. 我的ListView中有3种类型。 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. 一种是不可选择的,并且也不会具有焦点行为(使用的属性IsHitTestVisible = false )。一种是可选的,可以具有焦点颜色(正确工作)。一种应该是可选的,但不应具有焦点状态。

IsEnabled changes the transparancy and is unselectable so no option. IsEnabled更改透明度,并且无法选择,因此没有选项。 IsHitTestVisible doesnt change the transparancy but make the item also unclickable. IsHitTestVisible不会更改透明度,但也会使该项目不可单击。

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. 您可以为列表视图创建ViewCellRenderer For Reference you can use this link: 作为参考,您可以使用以下链接:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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