0
我是windows phone開發新手,我想知道WP7中是否有類似timedelay的東西。WP7中Popup的時間延遲
因爲我想在完全加載圖片幾秒後顯示Popup(例如5秒後我需要自動打開一個彈出窗口),而無需點擊任何按鈕。
截至目前我正在這樣做,但它會在圖像加載後立即打開Popup。
Public Sub New()
InitializeComponent()
photoChooserTask = New PhotoChooserTask()
AddHandler photoChooserTask.Completed, AddressOf photoChooserTask_Completed
End Sub
Dim photoChooserTask As PhotoChooserTask
添加圖像:
Private Sub AddImage_Click(sender As System.Object, e As System.EventArgs)
Try
photoChooserTask.Show()
Catch ex As System.InvalidOperationException
MessageBox.Show("An error occurred.")
End Try
End Sub
AFER加載圖片:
Private Sub photoChooserTask_Completed(sender As Object, e As PhotoResult)
If e.TaskResult = TaskResult.OK Then
'Code to display the photo on the page in an image control named myImage.
Dim bmp As System.Windows.Media.Imaging.BitmapImage = New System.Windows.Media.Imaging.BitmapImage()
bmp.SetSource(e.ChosenPhoto)
myImage.Source = bmp
End If
Dim popup As New Popup()
popup.VerticalOffset = 140
Dim control As New PhonePage3()
popup.Child = control
popup.IsOpen = True
End Sub
End Sub
@ Torben-這是好的沒問題即使它在C#中也不需要抱歉,我可以管理。感謝實際上,現在我正在嘗試與後臺工作:) – coder 2012-03-07 10:27:01