Back to Devexpress

SparklineEdit.PointArgumentMember Property

wpf-devexpress-dot-xpf-dot-editors-dot-sparklineedit-8c48c4d5.md

latest6.8 KB
Original Source

SparklineEdit.PointArgumentMember Property

Specifies the name of a binding for data point arguments.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public string PointArgumentMember { get; set; }
vb
Public Property PointArgumentMember As String

Property Value

TypeDescription
String

A String value.

|

Remarks

The PointArgumentMember and SparklineEdit.PointValueMember properties together define how to generate data points for a sparkline.

Example

This example demonstrates how to provide data for a standalone SparklineEdit control and adjust its main properties.

View Example

xaml
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        x:Class="SparklineEdit.MainWindow"
        Title="MainWindow" Height="228" Width="525" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        01/02/2000
        01/07/2000
    </Window.Resources>
    <Grid x:Name="grid">
        <dxe:SparklineEdit EditValue="{Binding SourceCollection}" 
                           PointValueMember="ValueColumn" PointArgumentMember="ArgumentColumn" >
            <dxe:SparklineEdit.PointArgumentRange>
                <dxe:Range Auto="False"
                    Limit1="{Binding Source={StaticResource ResourceKey=Limit1}}" 
                    Limit2="{Binding Source={StaticResource ResourceKey=Limit2}}" />
            </dxe:SparklineEdit.PointArgumentRange>
            <dxe:SparklineEdit.StyleSettings>
                <dxe:AreaSparklineStyleSettings 
                    LineWidth="3"
                    AreaOpacity="0.5"
                    ShowMarkers="True" 

                    MarkerSize="3"
                    MaxPointMarkerSize="10"
                    MinPointMarkerSize="9"
                    StartPointMarkerSize="8"
                    EndPointMarkerSize="7"
                    NegativePointMarkerSize="6"

                    HighlightMaxPoint="True" 
                    HighlightMinPoint="True" 
                    HighlightStartPoint="True"
                    HighlightEndPoint="True"
                    HighlightNegativePoints="True"

                    Brush="DarkBlue"
                    MaxPointBrush="#FFF5DA2A"
                    MinPointBrush="#FF2B0DEA"
                    StartPointBrush="#FF127A0D"
                    EndPointBrush="#FFF71616"
                    NegativePointBrush="#FF9C0404"
                    MarkerBrush="Black" />
            </dxe:SparklineEdit.StyleSettings>
        </dxe:SparklineEdit>
    </Grid>
</Window>
vb
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.Collections.ObjectModel
Imports System.Windows

Namespace SparklineEdit

    Partial Public Class MainWindow
        Inherits Window

        Private privateSourceCollection As IList
        Public Property SourceCollection() As IList
            Get
                Return privateSourceCollection
            End Get
            Set(ByVal value As IList)
                privateSourceCollection = value
            End Set
        End Property

        Public Sub New()
            InitializeComponent()

            grid.DataContext = Me

            GenerateData(7)
        End Sub

        Private Sub GenerateData(ByVal n As Integer)
            SourceCollection = New ObservableCollection(Of CustomElement)()

            Dim rnd As New Random()
            For i As Integer = 1 To n
                SourceCollection.Add(New CustomElement() With {.ArgumentColumn = New DateTime(2000, 1, i), .ValueColumn = rnd.Next(20), .FilteringColumn = 1})
            Next i

        End Sub
    End Class

    Public Class CustomElement
        Private privateArgumentColumn As Object
        Public Property ArgumentColumn() As Object
            Get
                Return privateArgumentColumn
            End Get
            Set(ByVal value As Object)
                privateArgumentColumn = value
            End Set
        End Property
        Private privateValueColumn As Integer
        Public Property ValueColumn() As Integer
            Get
                Return privateValueColumn
            End Get
            Set(ByVal value As Integer)
                privateValueColumn = value
            End Set
        End Property
        Private privateFilteringColumn As Integer
        Public Property FilteringColumn() As Integer
            Get
                Return privateFilteringColumn
            End Get
            Set(ByVal value As Integer)
                privateFilteringColumn = value
            End Set
        End Property
    End Class

End Namespace
csharp
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Windows;

namespace SparklineEdit {

    public partial class MainWindow : Window {

        public IList SourceCollection { get; set; }

        public MainWindow() {
            InitializeComponent();

            grid.DataContext = this;

            GenerateData(7);
        }

        private void GenerateData(int n) {
            SourceCollection = new ObservableCollection<CustomElement>();

            Random rnd = new Random();
            for (int i = 1; i <= n; i++) {
                SourceCollection.Add(new CustomElement() {
                    ArgumentColumn = new DateTime(2000, 1, i),
                    ValueColumn = rnd.Next(20),
                    FilteringColumn = 1
                });
            }

        }
    }

    public class CustomElement {
        public object ArgumentColumn { get; set; }
        public int ValueColumn { get; set; }
        public int FilteringColumn { get; set; }
    }

}

See Also

SparklineEdit Class

SparklineEdit Members

DevExpress.Xpf.Editors Namespace