为选定的 Listview 项目 2 禁用蓝色边框 [英] Disable blue border for selected Listview item 2

查看:24
本文介绍了为选定的 Listview 项目 2 禁用蓝色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处的新主题:x:Static 扩展在 WinRT-XAML 中是否有效?

我发现了这个禁用所选列表视图项的蓝色边框但它对我不起作用.我有一些错误 - >错误:无法识别或无法访问成员资源"."错误 2:在类型 'ListView' 中找不到可附加属性 'Resources'."错误 3:在解析规则 'NonemptyPropertyElement ::= 中出现意外的 'ATTRIBUTE'.PROPERTYELEMENT 内容?ENDTAG.'."行号'11'和行位置'29'."错误 4:未找到类型 'x:Static'.请确认您没有缺少程序集引用,并且所有引用的程序集都已构建."

I found this Disable blue border for selected Listview item but it does not working for me. I have some bug in -> Error: "The member "Resources" is not recognized or is not accessible." Error 2: "The attachable property 'Resources' was not found in type 'ListView'." Error 3: "'Unexpected 'ATTRIBUTE' in parse rule 'NonemptyPropertyElement ::= . PROPERTYELEMENT Content? ENDTAG.'.' Line number '11' and line position '29'." Error 4: "The type 'x:Static' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."

这是我的代码 XAML:

There is my code XAML:

<ListView.Resources x:Name="gui_listView" HorizontalAlignment="Left" Height="610" Margin="48,54,0,0" VerticalAlignment="Top" Width="256" SelectionChanged="gui_listView_SelectionChanged" SelectionMode="Extended">
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" 
                 Color="Transparent"/>
    </ListView.Resources>

我真的不知道我做错了什么,我不擅长 XAML,可能我犯了一些愚蠢的错误.有人可以给我写信吗,应该怎么写?感谢大家的回复.

I really dont know what am i doing wrong, im not good in XAML, probably im doing some stupid mistake. Can someone write me, how it should be? Thank's for all response.

推荐答案

不确定这是否是整个问题,但至少您需要将该 XAML 代码块放在 标记中,并设置 的属性,而不是 :

Not sure if this is the entire problem, but at least you need to put that XAML code block within <ListView> tag, and set attribute of the <ListView> as opposed to <ListView.Resources> :

<ListView x:Name="gui_listView" HorizontalAlignment="Left" 
          Height="610" Margin="48,54,0,0" VerticalAlignment="Top" 
          Width="256" SelectionChanged="gui_listView_SelectionChanged" 
          SelectionMode="Extended">
    <ListView.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" 
                 Color="Transparent"/>
    </ListView.Resources>
</ListView>

这篇关于为选定的 Listview 项目 2 禁用蓝色边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆