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

RadJumpList Selected Item Background

6 Answers 138 Views
JumpList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Randhir
Top achievements
Rank 1
Randhir asked on 17 Jun 2011, 06:06 AM
Hi,

I have been using Telerik Controls for windows phone 7. By default selected item for RadJumpList has blue foreground color: Can i have selected item background color changed.

Plesae help,
thank's

6 Answers, 1 is accepted

Sort by
0
Viperal
Top achievements
Rank 1
answered on 17 Jun 2011, 12:01 PM
I noticed this in the Q2 2011 beta (not sure about the Q1 release)

I was able to get around it by setting the Foreground color.   I'm thinking that it should really be up to the developer to add the color change and not have it done by default.

The below will add the themes default color and stop the color change.  (Works in the Q2 2011 Beta)

Foreground="{StaticResource PhoneForegroundBrush}"
0
Deyan
Telerik team
answered on 20 Jun 2011, 08:41 AM
Hi Ryan and Randhir,

By default, both RadDataBoundListBox and RadJumpList use the Accent color of the phone (the currently selected theme color) to define the foreground of the selected item. This is by design and could easily be changed by changing the template of the visual item or by simply setting a new foreground color upon the SelectionChanged event.

Let me know if you have further questions or need assistance.

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
Randhir
Top achievements
Rank 1
answered on 23 Jun 2011, 08:07 PM
Hi Deyan,

Thanks for the reply. Could please explain the steps in expression blend to change the selectedstate style.
I have already worked with visual states and changed the selected state template in expression blend 4 for list. When i open this RadJumplist control in expression blend i do not get any option.

Thank's
Randhir
0
Deyan
Telerik team
answered on 24 Jun 2011, 09:23 AM
Hi Randhir,

We have made some investigations and it seems that we still need to extend the design-time support of RadDataBoundListBox/RadJumpList to allow for editing ItemContainerStyles in Expression Blend. With the current version of the controls this is not possible. We have logged this in our TODO system and will provide the possibility for the Q2 2011 release of RadControls for Windows Phone 7 (scheduled for mid July).

For now, you can use the style I am pasting here and edit it according to your requirements. You can use the ItemContainerStyle property of RadJumpList to override the default style of the visual containers.

<Style TargetType="telerikPrimitives:RadDataBoundListBoxItem">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="BorderBrush" Value="Transparent" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="CacheMode" Value="BitmapCache"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerikPrimitives:RadDataBoundListBoxItem">
                <Border x:Name="LayoutRoot" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver" />
                            <VisualState x:Name="Disabled">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimation Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Opacity" Duration="0" To=".5" />
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="SelectionStates">
                            <VisualState x:Name="Unselected"/>
                            <VisualState x:Name="Selected">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <ContentControl x:Name="ContentContainer"
                                      HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                      VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                      HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                      VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                      Margin="{TemplateBinding Padding}"
                                      Content="{TemplateBinding Content}"
                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                      />
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

I hope this helps.

Do not hesitate to get back to us in case you have further questions or need assistance.

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
Randhir
Top achievements
Rank 1
answered on 03 Jul 2011, 06:58 AM
Hi Deyan,

I was able to change the foreground color but i was not able to change the background color of the selected item.

Please help,
Thank's
Randhir
0
Deyan
Telerik team
answered on 04 Jul 2011, 07:11 AM
Hello Randhir,

Could you please prepare a sample project that demonstrates your approach and send it to us so that we can directly take a look at it and see how we can help you further. Please note that you will have to open a new support ticket in order to be able to attach your project.

Thanks for your time.

Regards,
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
JumpList
Asked by
Randhir
Top achievements
Rank 1
Answers by
Viperal
Top achievements
Rank 1
Deyan
Telerik team
Randhir
Top achievements
Rank 1
Share this question
or