Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
How can i create callout for a popup in wpf.iam attaching the code below.
<UserControl x:Class="WpfApplication1.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="104" d:DesignWidth="564">
    <UserControl.Resources>
        <Storyboard x:Name="StatusFader" x:Key="StatusFader"  Completed="StatusFader_Completed">
            <DoubleAnimation Storyboard.TargetName="popupBackground" Storyboard.TargetProperty="Opacity" From="0.7" To="0" BeginTime="0:0:0"  Duration="0:0:4.5">
                <!--<DoubleAnimation.EasingFunction>
                    <ExponentialEase Exponent="10" EasingMode="EaseIn" />
                </DoubleAnimation.EasingFunction>-->
            </DoubleAnimation>
        </Storyboard>
    </UserControl.Resources>
    <Grid Height="43" Width="289" AllowDrop="True" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="39*" />
            <ColumnDefinition Width="225*" />
        </Grid.ColumnDefinitions>
        <Popup Name="popup" Placement="Center" PopupAnimation="Fade" AllowsTransparency="True"  Grid.ColumnSpan="2" Height="100">
            <Border BorderBrush="CornflowerBlue"            
            BorderThickness="3,3,3,3"
            CornerRadius="10"
                    
            removed="Beige">
                <Grid removed="Transparent">
                    <Grid Name="popupBackground" removed="Beige" Grid.Column="0" Grid.Row="0" />
                    <Label  Name="popupLabel" DockPanel.Dock="Bottom" HorizontalAlignment="Center"   VerticalAlignment="Center" Background="Transparent" Grid.Column="0" Grid.Row="0"/>
                </Grid>
            </Border>
        </Popup>
    </Grid>
</UserControl>

/////.cs/////
  void StatusFader_Completed(object sender,EventArgs e) {
      popup.IsOpen = false;
    }
    public void ShowDialogBox(string message)
    {

      popupLabel.Content = message;
      Storyboard StatusFader = (Storyboard)Resources["StatusFader"];
      popup.IsOpen = true;
     StatusFader.Begin();
    }
Posted
Comments
Thomas Duwe 25-Oct-12 4:12am    
What do you mean with callout? What do you want to achieve?
sajithnet 19-Nov-12 3:15am    
Sorry for very late reply Thomas,Please view the below link. http://social.msdn.microsoft.com/Forums/en-AU/wpf/thread/5a81d39d-a77c-470e-9b73-d664490ffa4f

1 solution

To anyone trying to figure this out - it seems like this is the answer: How to create CallOut for Popup[^]

Kind regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900