-
February 26th, 2014, 03:51 PM
#1
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
-
March 1st, 2014, 03:05 PM
#2
Re: Storyboard
This like the never ending story.
-
March 2nd, 2014, 11:14 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|