You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

ListSourceDataAdapter Class

A data adapter that loads data from list sources and displays it on vector layers.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v21.2.dll

Declaration

[ListSourceCustomBindingProperties]
public class ListSourceDataAdapter :
    DataSourceAdapterBase

Remarks

ListSourceDataAdapter handles notifications from objects that inherit the INotifyCollectionChanged and INotifyPropertyChanged interfaces. Since the BindableBase class implements the INotifyPropertyChanged interface, you can implement your Model class as a descendant of the BindableBase class to apply data source changes to the Map Control automatically:

public class MyModel: BindableBase {
  public string Name { get; set; }

  public double Latitude {
      get { return GetValue<double>(nameof(Latitude)); }
      set { SetValue(value, nameof(Latitude)); }
  }

  public double Longitude {
      get { return GetValue<double>(nameof(Longitude)); }
      set { SetValue(value, nameof(Longitude)); }
  }
}

Example

Follow the steps below to use the ListSourceDataAdapter:

  1. Create a ListSourceDataAdapter object and assign it to the VectorLayer.Data property.
  2. Specify the DataSourceAdapterBase.DataSource property.
  3. Configure the ListSourceDataAdapter.Mappings property to assign data source field values to map items.
  4. Use the ListSourceDataAdapter.ItemSettings property to specify map item settings.

View Example

<dxm:VectorLayer.Data>
    <dxm:ListSourceDataAdapter DataSource="{Binding Source={StaticResource data}, XPath=Ship}">
        <dxm:ListSourceDataAdapter.AttributeMappings>
            <dxm:MapItemAttributeMapping Name="Name" Member="Name"/>
            <dxm:MapItemAttributeMapping Name="Year" Member="Year"/>
            <dxm:MapItemAttributeMapping Name="Description" Member="Description"/>
        </dxm:ListSourceDataAdapter.AttributeMappings>
        <dxm:ListSourceDataAdapter.Mappings>
            <dxm:MapItemMappingInfo Latitude="Latitude" Longitude="Longitude"/>
        </dxm:ListSourceDataAdapter.Mappings>
        <dxm:ListSourceDataAdapter.ItemSettings>
            <dxm:MapCustomElementSettings ContentTemplate="{Binding Source={StaticResource itemTemplate}}"/>
        </dxm:ListSourceDataAdapter.ItemSettings>
    </dxm:ListSourceDataAdapter>
</dxm:VectorLayer.Data>
See Also