Deep content change doesn't work !

3 posts, 1 answers
  1. MahMah
    MahMah avatar
    18 posts
    Member since:
    Dec 2011

    Posted 04 Apr 2012 Link to this post

    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. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 04 Apr 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. MahMah
    MahMah avatar
    18 posts
    Member since:
    Dec 2011

    Posted 04 Apr 2012 Link to this post

    Thanks Pana for giving the idea. Its a good solution.

    Regards,

Back to Top