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

What wrong with this? Why do I see 2 labels?

4 Answers 36 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 30 Mar 2012, 07:32 PM


Hi.. I'm trying to do a transition when the content of the label changes - but I'm seeing 2 labels.
What am I doing wrong. The transition only works on the second label.
thanks again!

 

 

<sdk:Label x:Name="lblRegions" Content="Regions" FontSize="18" Foreground="Navy" FontFamily="Segoe UI" HorizontalAlignment="Center"/>

 

 

<telerik:RadTransitionControl Content="{Binding Content, ElementName=lblRegions}" HorizontalAlignment="Center" Duration="00:00:02">

 

 

<telerik:RadTransitionControl.Transition>

 

 

<telerik:FlipWarpTransition/>

 

 

</telerik:RadTransitionControl.Transition>

 

 

</telerik:RadTransitionControl>

4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 04 Apr 2012, 09:17 AM
Hello Jon,

From your sample code it seems that you are displaying the Content of the lblRegions in both - in the label itself and in the RadTransitionControl. This is the reason why you see the label twice.

If you give us more details on what you want you want to animate and when, I would be able to give you some ideas how to achieve it. In general the RadTransitionControls is a ContentControl and behaves as such and just animate its content when one of its Content or ContentTemplate properties is changed. For more information how to use it, please refer to this article.

Hope this helps.

Greetings,
Miroslav Nedyalkov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Jon_BCV
Top achievements
Rank 1
answered on 04 Apr 2012, 12:09 PM
Hi..
I'm just trying to animate the label content/text when I programmatically change it.
Can you please provide sampel code?thanks
0
Miroslav Nedyalkov
Telerik team
answered on 06 Apr 2012, 11:14 AM
Hello,

What I would suggest you is to place the Label control in the ContentTemplate of the RadTransitionControl and to bind its Content to the DataContext of the template. After that in your code, instead of changing the Label's content, just change the content of the transition control.

Here is an example of the described idea, using the code you provided:

<telerik:RadTransitionControl x:Name="lblRegions" Content="Regions" HorizontalAlignment="Center" Duration="00:00:02">
    <telerik:RadTransitionControl.ContentTemplate>
        <DataTemplate>
            <sdk:Label Content="{Binding}" FontSize="18" Foreground="Navy" FontFamily="Segoe UI" HorizontalAlignment="Center"/>
        </DataTemplate>
    </telerik:RadTransitionControl.ContentTemplate>
    <telerik:RadTransitionControl.Transition>
        <telerik:FlipWarpTransition/>
    </telerik:RadTransitionControl.Transition>
</telerik:RadTransitionControl>

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jon_BCV
Top achievements
Rank 1
answered on 06 Apr 2012, 01:04 PM
Thanks!!!!!!!!!!!!!!!
Tags
TransitionControl
Asked by
Jon
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Jon_BCV
Top achievements
Rank 1
Share this question
or