Private ToastMessagePage As Page ' in Process_Globals sub
Sub ShowToastMessage(Text As String, Duration As Int, aPage As Page)
ToastMessagePage = aPage
Dim NaObj As NativeObject
NaObj = NaObj.Initialize("MBProgressHUD").RunMethod("showHUDAddedTo:animated:",Array(aPage.RootPanel,True))
NaObj.SetField("labelText",Text)
NaObj.SetField("mode",5)
Dim T As Timer
T.Initialize("ToastMessage",Duration)
T.Enabled = True
End Sub
Sub ToastMessage_Tick
Dim T As Timer = Sender
T.Enabled = False
Dim NaObj As NativeObject
NaObj = NaObj.Initialize("MBProgressHUD").RunMethod("hideHUDForView:animated:",Array(ToastMessagePage.RootPanel,True))
End Sub