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

Set background color for selected item

3 Answers 107 Views
LoopingList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
IDispose
Top achievements
Rank 1
IDispose asked on 02 May 2011, 06:22 PM
Following the instructions in the help document, I am unable to set the background color for the selected item Here is the setting I am using,

<VisualState x:Name="Selected">
    <Storyboard>
        <DoubleAnimation Storyboard.TargetName="contentPresenter" 
	Storyboard.TargetProperty="Opacity" 
        To="1" 
        Duration="0"/>
        <DoubleAnimation Duration="0" To="24" 
        Storyboard.TargetProperty="(Control.FontSize)" 
        Storyboard.TargetName="contentPresenter" 
        d:IsOptimized="True"/>
        <DoubleAnimation Duration="0" 
        To="Pink" 
        Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" 
        Storyboard.TargetName="contentPresenter" 
        d:IsOptimized="True"/>
        </Storyboard>
</VisualState>

Please advise

thanks
ramesh

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 04 May 2011, 03:02 PM
Hello Ramesh,

Thanks for writing.

Please try using a ObjectAnimationUsingKeyFrames to set the color:

<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="contentPresenter">
    <DiscreteObjectKeyFrame KeyTime="0" Value="Pink"/>
</ObjectAnimationUsingKeyFrames>

You cannot animate colors by using a DoubleAnimation since the color is not a double value.

I hope this helps.

Best wishes,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
IDispose
Top achievements
Rank 1
answered on 04 May 2011, 04:18 PM
Deyan
Thank you for the response and alerting me to why DoubleAnimation does not work.

Unfortunately, the suggested solution does not work, The background color is not being set.

Anything else to try?
0
Deyan
Telerik team
answered on 05 May 2011, 08:03 AM
Hi Ramesh,

Thanks for getting back to me and for the provided feedback.

In this case, I would like to kindly ask you to prepare a sample application that we can use to reproduce the case and see how we can help.

You can upload the requested application in the support ticket you have opened regarding the same topic.

Thanks for your time.

Best wishes,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
LoopingList
Asked by
IDispose
Top achievements
Rank 1
Answers by
Deyan
Telerik team
IDispose
Top achievements
Rank 1
Share this question
or