Xceed Toolkit for .NET Maui v2.0 Documentation
Xceed.Maui.Toolkit Assembly / Xceed.Maui.Toolkit Namespace / Series Class / DataPointsSourceBindingInfos Property
Example


In This Topic
    DataPointsSourceBindingInfos Property
    In This Topic
    Gets or sets the binding information that allows to match some of the UserObject's properties with the XY or Text properties, which is a necessary step in order to display the SeriesDataPoints.
    Syntax
    'Declaration
     
    
    Public Property DataPointsSourceBindingInfos As ObservableCollection(Of BindingInfos)
    'Usage
     
    
    Dim instance As Series
    Dim value As ObservableCollection(Of BindingInfos)
     
    instance.DataPointsSourceBindingInfos = value
     
    value = instance.DataPointsSourceBindingInfos
    public ObservableCollection<BindingInfos> DataPointsSourceBindingInfos {get; set;}
    Example

    In the following example, "UserObjects" is a property on which the Series binds to in order to retrieve a collection of UserObjects.

    To display the SeriesDataPointsBindingInfos objects are used; these objects are set inside the DataPointsSourceBindingInfos property so that each UserObject.Id property will be set as X on the Chart's horizontal Axis & that the UserObject.Goals property will be set as Y on the Chart's vertical Axis. These bindings make sure that all DataPoints are located correctly in the Chart.

    Note that in addition to specifying the DataPointsSource, it is necessary to have one BindingInfos object for the horizontal Axis & another one for the vertical Axis in order for the DataPoints to be displayed correctly.

    <xctk:Chart.Series>
      <xctk:Series DataPointsSource="{Binding UserObjects, Source={x:Reference _contentPage}}">
        <xctk:Series.DataPointsSourceBindingInfos>
          <xctk:BindingInfos DataPointPropertyName="X"
                             UserObjectPropertyName="Id"/>
          <xctk:BindingInfos DataPointPropertyName="Y"
                             UserObjectPropertyName="Goals"/>
        </xctk:Series.DataPointsSourceBindingInfos>
      </xctk:Series>
    </xctk:Chart.Series>
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also