-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDataPointExtension.cs
More file actions
40 lines (36 loc) · 1.25 KB
/
DataPointExtension.cs
File metadata and controls
40 lines (36 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DataPointExtension.cs" company="OxyPlot">
// Copyright (c) 2014 OxyPlot contributors
// </copyright>
// <summary>
// Provides a markup extension for DataPoints.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using Avalonia.Markup.Xaml;
using System;
namespace OxyPlot.Avalonia
{
/// <summary>
/// Provides a markup extension for <see cref="DataPoint" />s.
/// </summary>
public class DataPointExtension : MarkupExtension
{
/// <summary>
/// The point
/// </summary>
private readonly DataPoint point;
/// <summary>
/// Initializes a new instance of the <see cref="DataPointExtension"/> class.
/// </summary>
/// <param name="x">The x-coordinate.</param>
/// <param name="y">The y-coordinate.</param>
public DataPointExtension(double x, double y)
{
point = new DataPoint(x, y);
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return point;
}
}
}