Click here to Skip to main content
15,887,746 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Mark Salsbery28-Nov-09 8:40
Mark Salsbery28-Nov-09 8:40 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Kunal Chowdhury «IN»6-Dec-09 7:07
professionalKunal Chowdhury «IN»6-Dec-09 7:07 
GeneralRe: Advantages and disadvantage using sliverlight Pin
Gopal_Kanchana6-Dec-09 18:43
Gopal_Kanchana6-Dec-09 18:43 
GeneralRe: Advantages and disadvantage using sliverlight Pin
Teun L9-Dec-09 1:33
Teun L9-Dec-09 1:33 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Abhinav S6-Dec-09 17:45
Abhinav S6-Dec-09 17:45 
GeneralRe: Advantages and disadvantage using sliverlight Pin
Kunal Chowdhury «IN»11-Dec-09 3:39
professionalKunal Chowdhury «IN»11-Dec-09 3:39 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Michael Eber19-Jan-10 6:24
Michael Eber19-Jan-10 6:24 
QuestionWPF - staggering storyboard executions Pin
gritter27-Nov-09 16:59
gritter27-Nov-09 16:59 
I am developing my first WPF app. It has some animations are essentially the same, but with different targets. I want to stagger their execution so they look random. I developed a storyboard for each target and gave each sb a unique name. To insert the delay, I am calling the storyboards from the code-behind. For testing I am using a button for my trigger. Eventually, form_load will trigger the animations. Also for testing purpose, I am only trying to run two storyboards, begin the 2nd one 8 seconds after the first.

My problem is that my storyboards both execution at the same time. After clicking the button, there's an 8 second delay and then they both run. I've tried separating the storyboards in two separate sub's. I've tried dimensioning individual storyboard variables. So far nothing seems to make a difference. I am sure this should be possible. In fact I imagine it's fairly common.

Any help will be appreciated. See code below...

Imports System
Imports System.IO
Imports System.Net
Imports System.Windows
Imports System.Threading
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Navigation

Class Window1

    Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

        'Call RunStoryBoard("GrowDrop1")
        Call RunStoryBoard1()

        'Thread.Sleep(800)
        Call Delay(8000)

        'Call RunStoryBoard("GrowDrop2")
        Call RunStoryBoard2()

    End Sub

    Private Sub RunStoryBoard(ByVal sbName As String)
        Dim myStoryBoard As Storyboard = DirectCast(FindResource(sbName), Storyboard)

        myStoryBoard.Begin(Me)

    End Sub

    Private Sub RunStoryBoard1()
        Dim myStoryBoard1 As Storyboard = DirectCast(FindResource("GrowDrop1"), Storyboard)

        myStoryBoard1.Begin(Me)

    End Sub

    Private Sub RunStoryBoard2()
        Dim myStoryBoard2 As Storyboard = DirectCast(FindResource("GrowDrop2"), Storyboard)

        myStoryBoard2.Begin(Me)

    End Sub

    Public Sub Delay(ByVal Milliseconds As UShort)
        Dim DelayTime As TimeSpan
        Dim NewTime As DateTime = DateTime.Now.AddSeconds(Milliseconds / 1000)
        Do
            DelayTime = NewTime.Subtract(DateTime.Now)

        Loop While DelayTime.Seconds > 0
    End Sub
End Class

AnswerRe: WPF - staggering storyboard executions Pin
gritter28-Nov-09 3:05
gritter28-Nov-09 3:05 
QuestionMDI type of application using WPF Pin
nilam247726-Nov-09 23:37
nilam247726-Nov-09 23:37 
QuestionWPF UserControl Inheritance in VB.NET? Pin
ThisIsJustAPunkRockSong25-Nov-09 23:08
ThisIsJustAPunkRockSong25-Nov-09 23:08 
Questionpolicy issue Pin
Tauseef A25-Nov-09 10:28
Tauseef A25-Nov-09 10:28 
AnswerRe: policy issue Pin
Mark Salsbery25-Nov-09 10:54
Mark Salsbery25-Nov-09 10:54 
QuestionRe: policy issue Pin
Tauseef A25-Nov-09 19:44
Tauseef A25-Nov-09 19:44 
AnswerRe: policy issue Pin
Mark Salsbery25-Nov-09 20:38
Mark Salsbery25-Nov-09 20:38 
QuestionRe: policy issue Pin
Tauseef A25-Nov-09 23:36
Tauseef A25-Nov-09 23:36 
AnswerRe: policy issue Pin
Tauseef A25-Nov-09 23:44
Tauseef A25-Nov-09 23:44 
GeneralRe: policy issue Pin
Mark Salsbery26-Nov-09 7:50
Mark Salsbery26-Nov-09 7:50 
GeneralRe: policy issue Pin
Tauseef A29-Nov-09 16:48
Tauseef A29-Nov-09 16:48 
QuestionProblem with ScreenSpaceLines3D Pin
Alaajabre25-Nov-09 1:04
Alaajabre25-Nov-09 1:04 
Questionwpf 3d transparency Pin
wpftester25-Nov-09 0:52
wpftester25-Nov-09 0:52 
AnswerRe: wpf 3d transparency Pin
Pete O'Hanlon25-Nov-09 1:47
mvePete O'Hanlon25-Nov-09 1:47 
QuestionGetting Started - WPF/ WCF/ WWF Pin
Anoop Brijmohun24-Nov-09 22:43
Anoop Brijmohun24-Nov-09 22:43 
AnswerRe: Getting Started - WPF/ WCF/ WWF Pin
Mark Salsbery25-Nov-09 15:55
Mark Salsbery25-Nov-09 15:55 
AnswerRe: Getting Started - WPF/ WCF/ WWF Pin
sisvis26-Nov-09 2:56
sisvis26-Nov-09 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.