I am using ArcGIS Pro SDK 3.
I have seen multiple examples in C# like this: ...
MapSelectionChangedEvent.Subscribe(OnSelectionChanged); private void OnSelectionChanged(MapSelectionChangedEventArgs args)
...
When I try to implement in VB.Net like this: ...
Dim subscriptionToken = Events.MapSelectionChangedEvent.Subscribe(OnSelectionChanged) Private Async Sub OnSelectionChanged(ByVal args As Events.MapSelectionChangedEventArgs)
... I get an error that says:
Argument not specified for parameter 'args' of 'Private Sub OnMapSelectionChanged(args As MapSelectionChangedEventArgs)'
Solved! Go to Solution.
Hi,
Subscribe parameter must be Action, not Sub. So, your code should look like that:
Dim eventAction As Action(Of Events.MapSelectionChangedEventArgs) = Sub(arg)
Dim selection = arg.Selection
Console.WriteLine("seelection count is {0}", selection.Count)
End Sub
Dim subscriptionToken = Events.MapSelectionChangedEvent.Subscribe(eventAction)
Hi,
Subscribe parameter must be Action, not Sub. So, your code should look like that:
Dim eventAction As Action(Of Events.MapSelectionChangedEventArgs) = Sub(arg)
Dim selection = arg.Selection
Console.WriteLine("seelection count is {0}", selection.Count)
End Sub
Dim subscriptionToken = Events.MapSelectionChangedEvent.Subscribe(eventAction)
Thank you.