modify event to task from wpf sdk to .net sdk

970
2
08-05-2016 06:43 AM
vineetdubey
New Contributor

can you give me example for modify event to task from wpf sdk to .net sdk.events are like GraphicMouseButtonEventArgs,GraphicMouseEventArgs,ExtentEventArgs,LengthsEventArgs,DrawEventArgs,TaskFailedEventArgs that are define in wpf using client dll but in .NET sdk we not found any class so we got a error

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

ArcGIS Runtime SDK for .NET uses a combination of both events and asynchronous tasks depending on the context. Can you provide some specific examples (with code) where you are having difficulty transitioning to the new API?

Cheers

Mike

0 Kudos
vineetdubey
New Contributor

Imports System.Windows

Imports System.Windows.Controls

Imports System.Windows.Input

Imports ESRI.ArcGIS.Client

Imports ESRI.ArcGIS.Client.Geometry

Imports System.ComponentModel

Namespace ArcGISWPFSDK

   Partial Public Class LocalToolkitFeatureDataGrid

   Inherits UserControl

   Implements INotifyPropertyChanged

   Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged

   Private _isBusy As Boolean = True

   Public Property IsBusy() As Boolean

   Get

   Return _isBusy

   End Get

   Set(value As Boolean)

  _isBusy = value

   RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("IsBusy"))

   End Set

   End Property

   Private _lastGraphic As Graphic

   Public Sub New()

  InitializeComponent()

   AddHandler MyMap.Layers.LayersInitialized, AddressOf map_LayersInitialized

   End Sub

   Private Sub map_LayersInitialized(sender As Object, e As EventArgs)

  DataContext = Me

  IsBusy = False

   End Sub

   Private Sub FeatureLayer_MouseLeftButtonUp(sender As Object, e As GraphicMouseButtonEventArgs)

   If _lastGraphic IsNot Nothing Then

  _lastGraphic.UnSelect()

   End If

  e.Graphic.[Select]()

   If e.Graphic.Selected Then

  MyDataGrid.ScrollIntoView(e.Graphic, Nothing)

   End If

  _lastGraphic = e.Graphic

   End Sub

   Private Sub MyMap_Loaded(sender As Object, e As RoutedEventArgs)

  MyDataGrid.Map = MyMap

  MyDataGrid.GraphicsLayer = TryCast(MyMap.Layers(1), ESRI.ArcGIS.Client.GraphicsLayer)

   End Sub

   End Class

End Namespace

there in new api we not have GraphicMouseButtonEventArgs so we got error

0 Kudos