// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) 2020 OxyPlot contributors // // // Represents a control that displays a . // // -------------------------------------------------------------------------------------------------------------------- using Avalonia; namespace OxyPlot.Avalonia { using global::Avalonia.Controls; using global::Avalonia.Media; using OxyPlot.Legends; /// /// 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 Legend. public partial class Legend : Control { /// /// Identifies the dependency property. /// public static readonly StyledProperty IsLegendVisibleProperty = AvaloniaProperty.Register(nameof(IsLegendVisible), true); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendBackgroundProperty = AvaloniaProperty.Register(nameof(LegendBackground), MoreColors.Undefined); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendBorderProperty = AvaloniaProperty.Register(nameof(LegendBorder), MoreColors.Undefined); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendBorderThicknessProperty = AvaloniaProperty.Register(nameof(LegendBorderThickness), 1.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendFontProperty = AvaloniaProperty.Register(nameof(LegendFont), null); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendFontSizeProperty = AvaloniaProperty.Register(nameof(LegendFontSize), 12.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendFontWeightProperty = AvaloniaProperty.Register(nameof(LegendFontWeight), FontWeight.Normal); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendItemAlignmentProperty = AvaloniaProperty.Register(nameof(LegendItemAlignment), global::Avalonia.Layout.HorizontalAlignment.Left); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendItemOrderProperty = AvaloniaProperty.Register(nameof(LegendItemOrder), LegendItemOrder.Normal); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendItemSpacingProperty = AvaloniaProperty.Register(nameof(LegendItemSpacing), 24.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendLineSpacingProperty = AvaloniaProperty.Register(nameof(LegendLineSpacing), 0d); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendMarginProperty = AvaloniaProperty.Register(nameof(LegendMargin), 8.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendMaxHeightProperty = AvaloniaProperty.Register(nameof(LegendMaxHeight), double.NaN); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendMaxWidthProperty = AvaloniaProperty.Register(nameof(LegendMaxWidth), double.NaN); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendOrientationProperty = AvaloniaProperty.Register(nameof(LegendOrientation), LegendOrientation.Vertical); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendColumnSpacingProperty = AvaloniaProperty.Register(nameof(LegendColumnSpacing), 8.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendPaddingProperty = AvaloniaProperty.Register(nameof(LegendPadding), 8.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendPlacementProperty = AvaloniaProperty.Register(nameof(LegendPlacement), LegendPlacement.Inside); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendPositionProperty = AvaloniaProperty.Register(nameof(LegendPosition), LegendPosition.RightTop); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendSymbolLengthProperty = AvaloniaProperty.Register(nameof(LegendSymbolLength), 16.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendSymbolMarginProperty = AvaloniaProperty.Register(nameof(LegendSymbolMargin), 4.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendSymbolPlacementProperty = AvaloniaProperty.Register(nameof(LegendSymbolPlacement), LegendSymbolPlacement.Left); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTextColorProperty = AvaloniaProperty.Register(nameof(LegendTextColor), MoreColors.Automatic); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTitleProperty = AvaloniaProperty.Register(nameof(LegendTitle), null); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTitleColorProperty = AvaloniaProperty.Register(nameof(LegendTitleColor), MoreColors.Automatic); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTitleFontProperty = AvaloniaProperty.Register(nameof(LegendTitleFont), null); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTitleFontSizeProperty = AvaloniaProperty.Register(nameof(LegendTitleFontSize), 12.0); /// /// Identifies the dependency property. /// public static readonly StyledProperty LegendTitleFontWeightProperty = AvaloniaProperty.Register(nameof(LegendTitleFontWeight), FontWeight.Bold); /// /// Identifies the dependency property. /// public static readonly StyledProperty EdgeRenderingModeProperty = AvaloniaProperty.Register(nameof(EdgeRenderingMode), EdgeRenderingMode.Automatic); /// /// Gets or sets LegendBackground. /// public Color LegendBackground { get { return GetValue(LegendBackgroundProperty); } set { SetValue(LegendBackgroundProperty, value); } } /// /// Gets or sets LegendBorder. /// public Color LegendBorder { get { return GetValue(LegendBorderProperty); } set { SetValue(LegendBorderProperty, value); } } /// /// Gets or sets LegendBorderThickness. /// public double LegendBorderThickness { get { return GetValue(LegendBorderThicknessProperty); } set { SetValue(LegendBorderThicknessProperty, value); } } /// /// Gets or sets the spacing between columns of legend items (only for vertical orientation). /// /// The spacing in device independent units. public double LegendColumnSpacing { get { return GetValue(LegendColumnSpacingProperty); } set { SetValue(LegendColumnSpacingProperty, value); } } /// /// Gets or sets LegendFont. /// public string LegendFont { get { return GetValue(LegendFontProperty); } set { SetValue(LegendFontProperty, value); } } /// /// Gets or sets LegendFontSize. /// public double LegendFontSize { get { return GetValue(LegendFontSizeProperty); } set { SetValue(LegendFontSizeProperty, value); } } /// /// Gets or sets LegendFontWeight. /// public FontWeight LegendFontWeight { get { return GetValue(LegendFontWeightProperty); } set { SetValue(LegendFontWeightProperty, value); } } /// /// Gets or sets LegendItemAlignment. /// public global::Avalonia.Layout.HorizontalAlignment LegendItemAlignment { get { return GetValue(LegendItemAlignmentProperty); } set { SetValue(LegendItemAlignmentProperty, value); } } /// /// Gets or sets LegendItemOrder. /// public LegendItemOrder LegendItemOrder { get { return GetValue(LegendItemOrderProperty); } set { SetValue(LegendItemOrderProperty, value); } } /// /// Gets or sets the horizontal spacing between legend items when the orientation is horizontal. /// /// The horizontal distance between items in device independent units. public double LegendItemSpacing { get { return GetValue(LegendItemSpacingProperty); } set { SetValue(LegendItemSpacingProperty, value); } } /// /// Gets or sets the vertical spacing between legend items. /// /// The spacing in device independent units. public double LegendLineSpacing { get { return GetValue(LegendLineSpacingProperty); } set { SetValue(LegendLineSpacingProperty, value); } } /// /// Gets or sets the max height of the legend. /// /// The max width of the legends. public double LegendMaxHeight { get { return GetValue(LegendMaxHeightProperty); } set { SetValue(LegendMaxHeightProperty, value); } } /// /// Gets or sets the max width of the legend. /// /// The max width of the legends. public double LegendMaxWidth { get { return GetValue(LegendMaxWidthProperty); } set { SetValue(LegendMaxWidthProperty, value); } } /// /// Gets or sets LegendMargin. /// public double LegendMargin { get { return GetValue(LegendMarginProperty); } set { SetValue(LegendMarginProperty, value); } } /// /// Gets or sets LegendOrientation. /// public LegendOrientation LegendOrientation { get { return GetValue(LegendOrientationProperty); } set { SetValue(LegendOrientationProperty, value); } } /// /// Gets or sets the legend padding. /// public double LegendPadding { get { return GetValue(LegendPaddingProperty); } set { SetValue(LegendPaddingProperty, value); } } /// /// Gets or sets LegendPlacement. /// public LegendPlacement LegendPlacement { get { return GetValue(LegendPlacementProperty); } set { SetValue(LegendPlacementProperty, value); } } /// /// Gets or sets the legend position. /// /// The legend position. public LegendPosition LegendPosition { get { return GetValue(LegendPositionProperty); } set { SetValue(LegendPositionProperty, value); } } /// /// Gets or sets LegendSymbolLength. /// public double LegendSymbolLength { get { return GetValue(LegendSymbolLengthProperty); } set { SetValue(LegendSymbolLengthProperty, value); } } /// /// Gets or sets LegendSymbolMargin. /// public double LegendSymbolMargin { get { return GetValue(LegendSymbolMarginProperty); } set { SetValue(LegendSymbolMarginProperty, value); } } /// /// Gets or sets LegendSymbolPlacement. /// public LegendSymbolPlacement LegendSymbolPlacement { get { return GetValue(LegendSymbolPlacementProperty); } set { SetValue(LegendSymbolPlacementProperty, value); } } /// /// Gets or sets LegendTitleFont. /// public string LegendTitleFont { get { return GetValue(LegendTitleFontProperty); } set { SetValue(LegendTitleFontProperty, value); } } /// /// Gets or sets the text color of the legends. /// public Color LegendTextColor { get { return GetValue(LegendTextColorProperty); } set { SetValue(LegendTextColorProperty, value); } } /// /// Gets or sets the legend title. /// public string LegendTitle { get { return GetValue(LegendTitleProperty); } set { SetValue(LegendTitleProperty, value); } } /// /// Gets or sets color of the legend title. /// public Color LegendTitleColor { get { return GetValue(LegendTitleColorProperty); } set { SetValue(LegendTitleColorProperty, value); } } /// /// Gets or sets the font size of the legend titles. /// public double LegendTitleFontSize { get { return GetValue(LegendTitleFontSizeProperty); } set { SetValue(LegendTitleFontSizeProperty, value); } } /// /// Gets or sets the font weight of the legend titles. /// public FontWeight LegendTitleFontWeight { get { return GetValue(LegendTitleFontWeightProperty); } set { SetValue(LegendTitleFontWeightProperty, value); } } /// /// Gets or sets a value indicating whether the legend is visible. /// public bool IsLegendVisible { get { return GetValue(IsLegendVisibleProperty); } set { SetValue(IsLegendVisibleProperty, value); } } /// /// Gets or sets the for the legend. /// public EdgeRenderingMode EdgeRenderingMode { get { return GetValue(EdgeRenderingModeProperty); } set { SetValue(EdgeRenderingModeProperty, value); } } } }