top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Explain Animated Popup control with its property?

+2 votes
308 views
Explain Animated Popup control with its property?
posted Feb 16, 2015 by Karthi Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

Once you have a popup content defined, you can do anything with this content depending on the controls. For instance, if you are using an image as content, you can do anything with the popup that you can do with the image.

The following code shows how to animate a popup window.

<StackPanel>  
    <CheckBox Name="PCheckBox" Margin="10,10,0,0"  
          Content="Popup Window"/>  
    <Button HorizontalAlignment="Left" Width="129" Margin="10,10,0,0">  
        <Button.Triggers>  
            <EventTrigger RoutedEvent="Button.Click">  
                <BeginStoryboard>  
                    <Storyboard>  
                        <DoubleAnimation   
            Storyboard.TargetName="theTransform"  
            Storyboard.TargetProperty="(RotateTransform.Angle)"   
            From="0" To="360" Duration="0:0:5" AutoReverse="True"/>  
                    </Storyboard>  
                </BeginStoryboard>  
            </EventTrigger>  
        </Button.Triggers>  
        Start Animation  
    </Button>  
    <Popup IsOpen="{Binding ElementName=PCheckBox,Path=IsChecked}"   
       PlacementTarget="{Binding ElementName=PCheckBox}"              
       AllowsTransparency="True"  
       PopupAnimation="Slide"  
       HorizontalOffset="150"  
       VerticalOffset="100">  
        <Canvas Width="100" Height="100" Background="Green" Margin="150">  
            <Canvas.RenderTransform>  
                <RotateTransform x:Name="theTransform" />  
            </Canvas.RenderTransform>  
            <TextBlock TextWrapping="Wrap" Foreground="LightGray">  
      Rotating Popup  
    </TextBlock>  
        </Canvas>  
    </Popup>  
</StackPanel>  
answer Feb 17, 2015 by Jdk
...