Hi
I'm hoping someone from esri can shed some light on some simple coding style. As requested in this idea there is a remarkable lack of sample code in Visual Basic. I've spent much of my career using VB and ArcObjects in ArcMap and now facing the challenge of developing in ArcPro. I would like to avoid having to sink months/possibly years into becoming proficient in c# when I know VB!
I understand that beneath the hood ArcPro is a very different beast requiring different coding styles because of its multi-threaded nature and that many things have to be done differently. That's OK when simple, easy to digest samples are provided to fast track ones self.
I've discovered that many of the objects I need to use must be run in a queuedtask but all the examples on the esri github site are all in the cryptic c# language.
I have some simple code that opens a layerfile on a onclick of a button. I cannot for the life of me work out the syntax that must be used in the line QueuedTask.Run().
Friend Class Button1
Inherits Button
Protected Overrides Sub OnClick()
' How To complete the Next line?
Await QueuedTask.Run()
End Sub
Private Function myCode() As LayerDocument
Dim sp As String
sp = "c:\scratch\mydata.lyrx"
Dim ld As LayerDocument
ld = New LayerDocument(sp)
Return ld
End Function
End Class
Can someone show how this code should be written and best practise?