Storyboard
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Storyboard

  1. #1
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    198

    Storyboard

    hi all,

    I have a storyboard.
    it drops a shadow under my window from 0 to 20 in one sec.
    so I want the shadow from 0 to 20 when the window activates and from 20 to 0 when it deactivates.

    I tried something like this:
    Code:
    Storyboard board;
    
            private void COD5WindowActivated(object sender, EventArgs e)
            {
                board = (Storyboard)TryFindResource("DropShadow");
                board.AutoReverse = false;
                board.BeginTime = new TimeSpan(0,0,0);
                board.Begin();
            }
    
            private void COD5WindowDeactivated(object sender, EventArgs e)
            {
                //board.Remove();
                //board = (Storyboard)TryFindResource("DropShadow");
                board.BeginTime = new TimeSpan(0, 0, 0, 0, 999);
                board.AutoReverse = true;
                board.Begin();
            }
    but it does not give me the wanted effect.

    Any suggestions?

    Regards,

    Ger

  2. #2
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,309

    Re: Storyboard

    This like the never ending story.

  3. #3
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    198

    Re: Storyboard

    The Story ends !!

    When I made the storyboard in Blend, Blend added an event Windowloaded, which I did not saw....

    the board is working with;
    Code:
    private async void COD5WindowActivated(object sender, EventArgs e)
            {
                board.Begin();
                await Task.Delay(1000);
                board.Pause();
            }
    
            private void COD5WindowDeactivated(object sender, EventArgs e)
            {
                board.Resume();
            }
    (removed the windowloaded event)

    regards,

    Ger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center