Question

Edit: new topic here: Do x:Static extensions work in WinRT-XAML?

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."

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>

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.

Was it helpful?

Solution

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top