12345678910111213141516171819202122232425262728293031323334353637383940 |
- // --------------------------------------------------------------------------------------------------------------------
- // <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;
- }
- }
- }
|