Opening a popup with a delay

754 views
Skip to first unread message

Laurent Bugnion [MVP]

unread,
May 28, 2009, 2:56:28 PM5/28/09
to wpf-di...@googlegroups.com

Hey guys,

 

Is there a way to open a popup with a slight delay (like a tooltip, not immediately when I mouse over an element) without using some code?

 

Cheers,

Laurent

--

Laurent Bugnion [Microsoft MVP, MCP]

Blog: http://blog.galasoft.ch

Web: http://www.galasoft.ch

Support children in Calcutta: http://www.calcutta-espoir.ch

 

cid:image001.png@01C9C8AA.B722DA80 My business card as Microsoft Tag

 

image001.png

Marlon Grech

unread,
May 28, 2009, 3:02:43 PM5/28/09
to wpf-di...@googlegroups.com
for tool tips you can use the attached property
ToolTipService.InitialShowDelay

Regards
Marlon
WPF Blog - http://marlongrech.wordpress.com/
image001.png

Sacha Barber

unread,
May 28, 2009, 3:29:31 PM5/28/09
to wpf-di...@googlegroups.com
Could you use a StoryBoard and animate the IsOpen property of Popup using DiscreteAnimation or something like that


From: lau...@galasoft.ch
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Opening a popup with a delay
Date: Thu, 28 May 2009 20:56:28 +0200

Surfing the web just got more rewarding. Download the New Internet Explorer 8
image001.png

Pavan Podila

unread,
May 28, 2009, 3:43:03 PM5/28/09
to WPF Disciples
There is also PopupAnimation that you can use. It is a enum-based
property of the Popup control.

On May 28, 3:29 pm, Sacha Barber <sachabar...@hotmail.com> wrote:
> Could you use a StoryBoard and animate the IsOpen property of Popup using DiscreteAnimation or something like that
>
> From: laur...@galasoft.ch
> To: wpf-di...@googlegroups.com
> Subject: [WPF Disciples] Opening a popup with a delay
> Date: Thu, 28 May 2009 20:56:28 +0200
>
> Hey guys,
>
> Is there a way to open a popup with
> a slight delay (like a tooltip, not immediately when I mouse over an element)
> without using some code?
>
> Cheers,
>
> Laurent
>
> --
>
> Laurent Bugnion
> [Microsoft MVP, MCP]
>
> Blog:http://blog.galasoft.ch
>
> Web:http://www.galasoft.ch
>
> Support children in Calcutta:http://www.calcutta-espoir.ch
>
>  My business card
> as Microsoft
> Tag
>
> _________________________________________________________________
> View your Twitter and Flickr updates from one place – Learn more!http://clk.atdmt.com/UKM/go/137984870/direct/01/
>
>  image001.png
> 7KViewDownload

Eric Burke

unread,
May 28, 2009, 4:01:39 PM5/28/09
to wpf-di...@googlegroups.com
This works (paste into Kaxaml):

<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <ContentPresenter>
  <ContentPresenter.ContentTemplate>
    <DataTemplate>
    <Grid>
    <CheckBox x:Name="cb" Width="100" Height="40">Click Me</CheckBox>
    <Popup x:Name="popup" Placement="Bottom" PlacementTarget="{Binding ElementName=cb}">
      <Border Width="400" Height="400" Background="Red"/>
    </Popup>
    </Grid>
    <DataTemplate.Triggers>
      <Trigger SourceName="cb" Property="IsChecked" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard x:Name="bsb">
            <Storyboard>
              <BooleanAnimationUsingKeyFrames
                Storyboard.TargetName="popup"
                Storyboard.TargetProperty="IsOpen"
                FillBehavior="HoldEnd">
                <DiscreteBooleanKeyFrame KeyTime="0:0:1.0" Value="True"/>
               </BooleanAnimationUsingKeyFrames>
            </Storyboard>
          </BeginStoryboard>
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <StopStoryboard BeginStoryboardName="bsb"/>
        </Trigger.ExitActions>
      </Trigger>
    </DataTemplate.Triggers>
    </DataTemplate>
    </ContentPresenter.ContentTemplate>
  </ContentPresenter>
</Page>


From: Sacha Barber <sacha...@hotmail.com>
To: "wpf-di...@googlegroups.com" <wpf-di...@googlegroups.com>
Sent: Thursday, May 28, 2009 3:29:31 PM
Subject: [WPF Disciples] Re: Opening a popup with a delay

Laurent Bugnion [MVP]

unread,
May 28, 2009, 4:17:56 PM5/28/09
to wpf-di...@googlegroups.com

Thanks guys. Yes storyboard seems the only way to go to do that in pure XAML.

 

Marlon, I cannot use a tooltip, the popup needs to remain open as long as the mouse is on the target or on the popup.

 

Pavan, PopupAnimation=Fade but it is still too fast, I want to avoid the popup popping up as soon as the mouse passes over the target, it is disturbing.

 

Thanks a lot guys!!

Laurent

Error! Filename not specified. My business card as Microsoft Tag

 

Sacha Barber

unread,
May 28, 2009, 4:27:14 PM5/28/09
to wpf-di...@googlegroups.com
For my part you is welcome. Though Eric went the extra mile.

Hwey Laurent we will more than likely be needing some SL guidance when the time comes to write bookey wookey, you down with fielding idiot questions?
Subject: [WPF Disciples] Re: Opening a popup with a delay
Date: Thu, 28 May 2009 22:17:56 +0200

Get the New Internet Explore 8 Optimised for MSN. Download Now

Laurent Bugnion [MVP]

unread,
May 28, 2009, 5:05:18 PM5/28/09
to wpf-di...@googlegroups.com

Bring them on, and we’ll discuss my fees (payable in beers and various alcohols) when we finally meet ;)

Reply all
Reply to author
Forward
0 new messages