This is a migrated thread and some comments may be shown as answers.

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

1 Answer 206 Views
UI for Universal Windows Apps
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Imen
Top achievements
Rank 1
Imen asked on 14 Jan 2016, 10:18 AM

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

 

 

1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 19 Jan 2016, 08:49 AM
Hi,

Thank you for contacting us.

Currently the only way to add visual effects on PointerOver, is to add the desired transition in the RadListViewItem's template.

I hope this helps.

Regards,
Ivaylo Gergov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
UI for Universal Windows Apps
Asked by
Imen
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or