WPF Popup : open with animation

17,381

Solution 1

From MSDN

A Popup can only animate when the AllowsTransparency property is set to true. This requires the application that creates the Popup control to run with full trust. If the PlacementTarget is animated, the Popup will not be animated.

XAML should look like

<DockPanel  Width="500" Background="Aqua">
  <Popup Placement="Center" PlacementRectangle="0,0,30,50"  
          IsOpen ="True" AllowsTransparency="True"
          PopupAnimation="Fade">
    <TextBlock Background="Purple">Popup Text</TextBlock>
  </Popup>
</DockPanel>

And you can read more here.

Solution 2

Popup will animate if you have set AllowsTransparency true. like -

AllowsTransparency="True".
Share:
17,381
Priyank Thakkar
Author by

Priyank Thakkar

• 9 years of experience in developing &amp; designing thin client and thick client applications using Java, Spring MVC, Hibernate, HTML, CSS3, jQuery, JavaScript, Eclipse Rich Client Platform, C#, .net framework, Windows Presentation Foundation (WPF) • Hands on experience on front-end UI frameworks like AngularJS, Foundation 6 and added skills like NodeJS and ExpressJS via web based trainings • Mentored newly inducted members of the team by providing them product knowledge &amp; provided technical trainings and grooming • Familiar with Waterfall and Agile methodologies. • Have been part of requirement brainstorming, design and development of applications, end to end development • Conduct technical interviews and get new developers for the team • Having passion for learning new things and enjoys a variety of work - ambitious and inquisitive

Updated on June 06, 2022

Comments

  • Priyank Thakkar
    Priyank Thakkar almost 2 years

    I am using a wpf popup control.

    <Popup x:Name="tabHolder" IsOpen="False" 
        PopupAnimation="Slide" Placement="Bottom" 
        PlacementTarget="{Binding ElementName=mainWidgetWindow}">
        <Grid Height="105" Width="315" />
    </Popup>
    

    Here I have set popup animation property to slide. But when it opens, it doesn't animate. Do I have to add any other configuration for popup to open with animation option slide?

    I am using .net framework version 3.5.