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

Enabling animation

5 Answers 187 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Pandit Prerna
Top achievements
Rank 1
Pandit Prerna asked on 26 Jan 2010, 08:33 PM
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

5 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 29 Jan 2010, 09:10 AM
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.
0
codeputer
Top achievements
Rank 2
answered on 01 Jul 2010, 08:30 PM
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?

 

 

 

0
Valentin.Stoychev
Telerik team
answered on 07 Jul 2010, 07:11 PM
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
0
codeputer
Top achievements
Rank 2
answered on 07 Jul 2010, 07:26 PM
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
0
Kiril Stanoev
Telerik team
answered on 13 Jul 2010, 12:13 PM
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
Tags
Expander
Asked by
Pandit Prerna
Top achievements
Rank 1
Answers by
Bobi
Telerik team
codeputer
Top achievements
Rank 2
Valentin.Stoychev
Telerik team
Kiril Stanoev
Telerik team
Share this question
or