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

Deep content change doesn't work !

2 Answers 40 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
MahMah
Top achievements
Rank 1
MahMah asked on 04 Apr 2012, 05:49 AM
Hello,
Suppose we have this XAML :

<StackPanel>
    <telerik:RadTransitionControl x:Name="tr1">
        <Label x:Name="lblMessage"></Label>
    </telerik:RadTransitionControl>
    <Button Content="Button"  Height="23" Name="button1" Width="75" Click="button1_Click" />
</StackPanel>

and when button1_Click has this code :
tr1.Content = DateTime.Now.ToString();
It works well.
 But replacing it with this code :
lblMessage.Content = DateTime.Now.ToString();
causes the transition to not to work !

It seems that it only detects first layer changes in content and doesn't detect deep change.

So have I forgotten something here or its the nature of this control ?

Regards,

2 Answers, 1 is accepted

Sort by
0
Accepted
Pana
Telerik team
answered on 04 Apr 2012, 06:36 AM
Hello,

The transition is triggered when a property of the RadTransitionControl is changed. For example Content or ContentTemplate. If you want to have a label inside and use a transition when the label's content changes you could create a DataTemplate for the ContentTemplate of the RadTransitionControl, put a Label inside and set Content="{Binding}" on that label. Then instead of setting the content of the Label - set the content of the RadTransitionControl. Every time you set new content, new label would be created with the text applied and a transition would be triggered.

We can not listen for changes in the whole visual tree of the RadTransitionControl.

Greetings,
Pana
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
MahMah
Top achievements
Rank 1
answered on 04 Apr 2012, 07:16 AM
Thanks Pana for giving the idea. Its a good solution.

Regards,

Tags
TransitionControl
Asked by
MahMah
Top achievements
Rank 1
Answers by
Pana
Telerik team
MahMah
Top achievements
Rank 1
Share this question
or