// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) 2014 OxyPlot contributors
//
//
// Represents a control that displays a .
//
// --------------------------------------------------------------------------------------------------------------------
using Avalonia;
using Avalonia.Media;
namespace OxyPlot.Avalonia
{
using global::Avalonia.Metadata;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
///
/// Represents a control that displays a .
///
/// This file contains dependency properties used for defining the Plot in XAML. These properties are only used when Model is null. In this case an internal PlotModel is created and the dependency properties are copied from the control to the internal PlotModel.
public partial class Plot
{
///
/// Identifies the dependency property.
///
public static readonly StyledProperty CultureProperty = AvaloniaProperty.Register(nameof(Culture), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty IsLegendVisibleProperty = AvaloniaProperty.Register(nameof(IsLegendVisible), true);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SelectionColorProperty = AvaloniaProperty.Register(nameof(SelectionColor), Colors.Yellow);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty> RenderingDecoratorProperty = AvaloniaProperty.Register>(nameof(RenderingDecorator), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SubtitleFontProperty = AvaloniaProperty.Register(nameof(SubtitleFont), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleColorProperty = AvaloniaProperty.Register(nameof(TitleColor), MoreColors.Automatic);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SubtitleColorProperty = AvaloniaProperty.Register(nameof(SubtitleColor), MoreColors.Automatic);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty DefaultFontProperty = AvaloniaProperty.Register(nameof(DefaultFont), "Segoe UI");
///
/// Identifies the dependency property.
///
public static readonly StyledProperty DefaultFontSizeProperty = AvaloniaProperty.Register(nameof(DefaultFontSize), 12d);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty> DefaultColorsProperty = AvaloniaProperty.Register>(nameof(DefaultColors), new[]
{
Color.FromRgb(0x4E, 0x9A, 0x06),
Color.FromRgb(0xC8, 0x8D, 0x00),
Color.FromRgb(0xCC, 0x00, 0x00),
Color.FromRgb(0x20, 0x4A, 0x87),
Colors.Red,
Colors.Orange,
Colors.Yellow,
Colors.Green,
Colors.Blue,
Colors.Indigo,
Colors.Violet
});
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxisTierDistanceProperty = AvaloniaProperty.Register(nameof(AxisTierDistance), 4d);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PlotAreaBackgroundProperty = AvaloniaProperty.Register(nameof(PlotAreaBackground), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PlotAreaBorderColorProperty = AvaloniaProperty.Register(nameof(PlotAreaBorderColor), Colors.Black);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PlotAreaBorderThicknessProperty = AvaloniaProperty.Register(nameof(PlotAreaBorderThickness), new Thickness(1.0));
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PlotMarginsProperty = AvaloniaProperty.Register(nameof(PlotMargins), new Thickness(double.NaN));
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PlotTypeProperty = AvaloniaProperty.Register(nameof(PlotType), PlotType.XY);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SubtitleFontSizeProperty = AvaloniaProperty.Register(nameof(SubtitleFontSize), 14.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SubtitleFontWeightProperty = AvaloniaProperty.Register(nameof(SubtitleFontWeight), FontWeight.Normal);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty SubtitleProperty = AvaloniaProperty.Register(nameof(Subtitle), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TextColorProperty = AvaloniaProperty.Register(nameof(TextColor), Colors.Black);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleAlignmentProperty = AvaloniaProperty.Register(nameof(TitleHorizontalAlignment), TitleHorizontalAlignment.CenteredWithinPlotArea);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontProperty = AvaloniaProperty.Register(nameof(TitleFont), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontSizeProperty = AvaloniaProperty.Register(nameof(TitleFontSize), 18.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontWeightProperty = AvaloniaProperty.Register(nameof(TitleFontWeight), FontWeight.Bold);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitlePaddingProperty = AvaloniaProperty.Register(nameof(TitlePadding), 6.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleProperty = AvaloniaProperty.Register(nameof(Title), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleToolTipProperty = AvaloniaProperty.Register(nameof(TitleToolTip), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty InvalidateFlagProperty = AvaloniaProperty.Register(nameof(InvalidateFlag), 0);
///
/// Initializes static members of the class.
///
static Plot()
{
PaddingProperty.OverrideDefaultValue(new Thickness(8));
PaddingProperty.Changed.AddClassHandler(AppearanceChanged);
CultureProperty.Changed.AddClassHandler(AppearanceChanged);
IsLegendVisibleProperty.Changed.AddClassHandler(AppearanceChanged);
SelectionColorProperty.Changed.AddClassHandler(AppearanceChanged);
RenderingDecoratorProperty.Changed.AddClassHandler(AppearanceChanged);
SubtitleFontProperty.Changed.AddClassHandler(AppearanceChanged);
TitleColorProperty.Changed.AddClassHandler(AppearanceChanged);
SubtitleColorProperty.Changed.AddClassHandler(AppearanceChanged);
DefaultFontProperty.Changed.AddClassHandler(AppearanceChanged);
DefaultFontSizeProperty.Changed.AddClassHandler(AppearanceChanged);
DefaultColorsProperty.Changed.AddClassHandler(AppearanceChanged);
AxisTierDistanceProperty.Changed.AddClassHandler(AppearanceChanged);
PlotAreaBackgroundProperty.Changed.AddClassHandler(AppearanceChanged);
PlotAreaBorderColorProperty.Changed.AddClassHandler(AppearanceChanged);
PlotAreaBorderThicknessProperty.Changed.AddClassHandler(AppearanceChanged);
PlotMarginsProperty.Changed.AddClassHandler(AppearanceChanged);
PlotTypeProperty.Changed.AddClassHandler(AppearanceChanged);
SubtitleFontSizeProperty.Changed.AddClassHandler(AppearanceChanged);
SubtitleFontWeightProperty.Changed.AddClassHandler(AppearanceChanged);
SubtitleProperty.Changed.AddClassHandler(AppearanceChanged);
TextColorProperty.Changed.AddClassHandler(AppearanceChanged);
TitleAlignmentProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontSizeProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontWeightProperty.Changed.AddClassHandler(AppearanceChanged);
TitlePaddingProperty.Changed.AddClassHandler(AppearanceChanged);
TitleProperty.Changed.AddClassHandler(AppearanceChanged);
TitleToolTipProperty.Changed.AddClassHandler(AppearanceChanged);
InvalidateFlagProperty.Changed.AddClassHandler((s, e) => s.InvalidateFlagChanged());
}
///
/// The annotations.
///
private readonly ObservableCollection annotations;
///
/// The axes.
///
private readonly ObservableCollection axes;
///
/// The series.
///
private readonly ObservableCollection series;
///
/// The legends.
///
private readonly ObservableCollection