Enabling animation

6 posts, 0 answers
  1. Pandit Prerna
    Pandit Prerna avatar
    14 posts
    Member since:
    Dec 2009

    Posted 26 Jan 2010 Link to this post

    I cannot enable animation if I set it part of style like this.
    <Style x:Key="RadExpanderStyle" TargetType="telerik:RadExpander">  
                <Setter Property="Telerik_Windows_Controls_Animation:AnimationManager.IsAnimationEnabled" Value="true" />   
                <Setter Property="Telerik_Windows_Controls_Animation:AnimationManager.AnimationSelector">  
                    <Setter.Value> 
                        <Telerik_Windows_Controls_Animation:AnimationSelector> 
                            <Telerik_Windows_Controls_Animation:ExpanderExpandCollapseAnimation AnimationName="Expand" Direction="In" TargetName="ContentElement" /> 
                            <Telerik_Windows_Controls_Animation:ExpanderExpandCollapseAnimation AnimationName="Collapse" Direction="Out" TargetName="ContentElement"/>  
                        </Telerik_Windows_Controls_Animation:AnimationSelector> 
                    </Setter.Value> 
                </Setter>           
            </Style> 

    It however works when I set it though code or set it to the control directly.

    <telerik:RadExpander x:Name="WorkRequestExpander" Margin="8,8,8,0" VerticalAlignment="Top" FontSize="14"   
                                     Expanded="WorkRequestExpander_Expanded" 
                                     Collapsed="WorkRequestExpander_Collapsed"   
                                     Background="{StaticResource BowneGrey2}" Style="{StaticResource RadExpanderStyle}" Telerik_Windows_Controls_Animation:AnimationManager.IsAnimationEnabled="true"

    Could I be missing something?

    Thanks

    PP
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 29 Jan 2010 Link to this post

    Hi Pandit Prerna,

    There is no need to use something like:
    <Setter Property="animation:AnimationManager.AnimationSelector"
    <Setter.Value>
                <animation:AnimationSelector>
                   <animation:ExpanderExpandCollapseAnimation
                  AnimationName="Expand" Direction="In" TargetName="ContentElement"      />
        <animation:ExpanderExpandCollapseAnimation AnimationName="Collapse" Direction="Out" TargetName="ContentElement" />
        </animation:AnimationSelector>
    </Setter.Value>
            </Setter>

    This is a part of the default Exmapder theme. I mean that "ContentElement" is a part of the ControlTemplate. If you want to Enable/Disable the animation with a Style  you can use the following:

    <Style x:Key="RadExpanderStyle" TargetType="telerik:RadExpander">
    <Setter Property="Telerik_Windows_Controls_Animation:AnimationManager.IsAnimationEnabled" Value="true" /> 
    </Style>
    .....
    <telerik:RadExpander x:Name="WorkRequestExpander" Style="{StaticResource RadExpanderStyle}" />


    However if you want to edit the full control template please take a look at the following article:
    http://www.telerik.com/help/silverlight/common-styling-appearance-edit-control-templates-blend.html
    I hope that this answers your question.


    Greetings,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. codputer
    codputer avatar
    45 posts
    Member since:
    Apr 2007

    Posted 01 Jul 2010 Link to this post

    I attempted to set animation using implicit styles - like this: 
            <Style  TargetType="telerik:RadExpander">  
                <Setter Property="animation:AnimationManager.IsAnimationEnabled" Value="True" /> 
            </Style> 

    but found it did not work. 

    I set this style in the App.xml file using this namespace reference:

     

    xmlns

     

     

    :animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls"

     

     

     

     

     

    Will implicit styles work with Telerik controls?  If so, does the name space reference have to be in the user control as well?

    I'm very new to the controls, and I'm looking for more information on Telerik animations.  Can you point me to it please?

     

     

     

  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 07 Jul 2010 Link to this post

    Hi codputer,

    The implicit styles will not work with Telerik controls. We will work on that in the next quarter. We don't have custom animations. The animations can be set on or off for some specific controls as mentioned in the previous replies.


    Best wishes,
    Valentin.Stoychev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. codputer
    codputer avatar
    45 posts
    Member since:
    Apr 2007

    Posted 07 Jul 2010 Link to this post

    I thought Implicit style were not the responsiblity of the control, but more so the responsibility of silverlight.  When Silverlight is rendering the control, the change that occurred to make implicit styles possible, was that Silverlight would use 1) the style that was explicidly set, or 2) use the style based on the type of the control.

    In this case, the telerick control (at this point Silverlight would not care who authored the control, only that it is a control) would see that no explicit style is set, and then look for an implicit style.  If found, they simply use the setter information to set the named property with the given value in the style.

    Assuming that all this is correct - the setter should be able to simply set the control as it is being rendered during runtime.  Can you give me an explanation as to whether my 1) assumptions are incorrected, or 2) why telerik control is not allowing the implicit style property setter to do it's job?

    Either way - I'm going to learn something new!

    Regards,
    Richard
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 13 Jul 2010 Link to this post

    Hi Richard,

    Our theming mechanism set Style property. This was the only possible way back in Silverlight 3. Now with the implicit style support in Silverlight 4 we will change our theming mechanism so that it will not set Style.
    So if you have set Theme to RadExpander implicit style for it will not work.

    Kind regards,
    Kiril Stanoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner