编辑:这里的新主题:Do x:Static extensions work in WinRT-XAML?
我找到了这个Disable blue border for selected Listview item,但它对我不管用。我在->错误中有一些错误:“成员”“参考资料”无法识别或无法访问。“错误2:“在‘ListView’类型中找不到可附加属性'Resources‘。”错误3:“在解析规则'NonemptyPropertyElement ::= . PROPERTYELEMENT内容? ENDTAG.'.‘行号'11’和行位置‘29’中的‘意外’属性。”错误4:“找不到‘x:静态’类型。请确认您没有丢失程序集引用,并且所有引用的程序集都已生成。”
这是我的代码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做的不好,可能我做了一些愚蠢的错误。有人能给我写信吗,该怎么写?谢谢你的回应。
发布于 2014-05-15 09:01:41
不确定这是否是整个问题,但至少您需要将XAML代码块放在<ListView>标记中,并设置<ListView>的属性,而不是<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>https://stackoverflow.com/questions/23673464
复制相似问题