Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

change the Foreground color when Hover on ListViewItem in a universal app

$
0
0

Hi, 

I am trying to set this Style to my ListViewItems when the Mouse hover on them:(attched file)

Then,I did a Style when Mouse hover on every ListViewItem,but this Style changes the Background when Hover not the Foreground color ,this is my try

<ListView Name="myList">

<ListView.ItemContainerStyle>

<Style TargetType="ListViewItem">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="ListViewItem">

<ListViewItemPresenter

        FocusSecondaryBorderBrush="#d9d7ec"

        PlaceholderBackground="#d9d7ec"

        PointerOverBackground="#d9d7ec"

        PointerOverForeground="#342d65"

        SelectedBackground="#d9d7ec"

        SelectedForeground="#342d65"

        SelectedPointerOverBackground="#d9d7ec"

        HorizontalContentAlignment="Stretch"

        VerticalContentAlignment="Center"

        Foreground="Gray" />

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

</ListView.ItemContainerStyle>

</ListView>

and this is How I apply this Style to the ListView:

<ListView >

<ListView.ItemTemplate >

<DataTemplate>

    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">

          <TextBlock x:Name="day" Text="{Binding Path=day}" Foreground="#797978">

         </TextBlock>

   </StackPanel>

</DataTemplate>

</ListView.ItemTemplate >

</ListView 

 So,please How can I change the Foreground color when Hover on ListViewItem

thanks for help

 

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>