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

AnimationSelector Expand/Collapse

1 Answer 107 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 07 May 2013, 08:11 PM
Hello,

I'm trying AnimationSelector Expand/Collapse not work in WPF in Silverlight not any problem. Thanks.

<Style x:Key="RadComboBoxStyle" TargetType="telerik:RadComboBox">
    <Setter Property="Template" Value="{StaticResource NonEditableComboBox}"/>
    <Setter Property="EditableTemplate" Value="{StaticResource EditableComboBox}"/>
    <Setter Property="NonEditableTemplate" Value="{StaticResource NonEditableComboBox}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="MinHeight" Value="22"/>
    <Setter Property="Padding" Value="4,0,20,0"/>
    <Setter Property="Background" Value="{StaticResource MarkerBrush}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="UseLayoutRounding" Value="True"/>
    <Setter Property="telerik:AnimationManager.AnimationSelector">
        <Setter.Value>
            <telerik:AnimationSelector>
                <telerik:AnimationGroup AnimationName="Expand">
                    <telerik:SlideAnimation Direction="In" SlideMode="Top" TargetElementName="PopupRoot"/>
                </telerik:AnimationGroup>
                <telerik:AnimationGroup AnimationName="Collapse">
                    <telerik:SlideAnimation Direction="Out" SlideMode="Top" TargetElementName="PopupRoot"/>
                </telerik:AnimationGroup>
            </telerik:AnimationSelector>
        </Setter.Value>
    </Setter>
    <Setter Property="FontFamily" Value="Segoe UI"/>
    <Setter Property="FontSize" Value="12"/>       
    <Setter Property="BorderBrush" Value="{StaticResource MainBrush}"/>
    <Setter Property="Foreground" Value="{StaticResource BasicBrush}"/>
    <Setter Property="ItemContainerStyle" Value="{StaticResource RadComboBoxItemStyle}"/>
</Style>

1 Answer, 1 is accepted

Sort by
0
Accepted
Masha
Telerik team
answered on 09 May 2013, 11:16 AM
Hello Steve,

Unfortunately the desired approach cannot be achieved in wpf applications.
AnimationManager.AnimationSelector property is supported for Silverlight only.

I can suggest you to create CustomComboBox something like this:
public class CustomComboBox : RadComboBox
{
    public override void OnApplyTemplate()
    {
        base.OnApplyTemplate();
 
        var popup = GetTemplateChild("PART_Popup") as System.Windows.Controls.Primitives.Popup;
        popup.Opened += popup_Opened;
    }
 
    void popup_Opened(object sender, EventArgs e)
    {
        var popup = GetTemplateChild("PART_Popup") as System.Windows.Controls.Primitives.Popup;
        popup.PopupAnimation = PopupAnimation.Fade;
    }
}

I hope this information will be helpful.

All the best,
Masha
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ComboBox
Asked by
Steve
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or