Class HighlightingItemBase
- Namespace
- LightningChartLib.WinForms.Charting
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
Base class for all LC objects that can be highlighted.
[TypeConverter(typeof(ExpandableObjectConverter))]
public abstract class HighlightingItemBase : UserInteractiveObject, IChartNode, IDisposable, IHighlightingItem
- Inheritance
-
HighlightingItemBase
- Implements
- Derived
- Inherited Members
Remarks
Highlighting style can be controlled through Highlight property.
Reading of the current highlighting state can be read using IsHighlighted() method.
This also makes it possible for the user to manually control forced highlighting of the object.
Presents HighlightedStateChanged event that notifies changes in the objects highlighted state.
Currently changing object visibility and/or highlight mode might not cause event to fire. This is a known problem.
Constructors
HighlightingItemBase()
Constructor.
public HighlightingItemBase()
HighlightingItemBase(IChartNode)
Constructor.
public HighlightingItemBase(IChartNode owner)
Parameters
ownerIChartNodeOwner object.
Properties
Highlight
Gets or sets highlight style. Item can be highlighted by user interactive device or by code.
public Highlight Highlight { get; set; }
Property Value
Methods
InvokeHighlightedStateChangedEvent(HighlightStateSource)
Invokes HighlightedStateChanged events.
protected virtual bool InvokeHighlightedStateChangedEvent(HighlightStateSource source)
Parameters
sourceHighlightStateSourceArguments to use instead of current objects stored MouseEvent arguments. Can be used to speed up speed up the call if the event is already constructed. Note that the object is not updated in any way if given, so it can be used to deliver wrong information.
Returns
- bool
Return value of the Charts RaiseEvent method. False if the event could not be emitted, true otherwise.
True emitting of the event succeeds. If no event listeners is registered, this should return true.
IsHighlighted()
returns true if the object is highlighted.
public virtual bool IsHighlighted()
Returns
- bool
True if the object is highlighted.
Remarks
Note that this value reflects the state of the object before it's drawn on screen, so if mouse is moved, this is set, and then a new frame is drawn. Prior version 8.0.1 returned value reflected the currently visible state, meaning that the state changed only after the new frame, and thus right after mouse hovering the state was kind of wrong.
For object to be highlighted, it needs to be visible, and mouse must be in top of it, highlighting must be set manually, or the item must be highlighted by hovering over legend box.
RemoveHighlight()
Removes forced highlighting.
public void RemoveHighlight()
Remarks
Note that this does not prevent the highlighting caused by mouse hovering.
SetHighlight()
Highlights the object.
This is a kind of "forced" highlight, and the object might be highlighted even if the highlighting type (defined by Highlight property) is set to None. How the highlighting happens, if any, depends on object. Most objects use the defined type by default, and fall back to Simple highlighting if None is set.
public void SetHighlight()
ToString()
Item to string.
public override string ToString()
Returns
- string
String.
Events
HighlightedStateChanged
Event telling that highlighted state has changed. Contains information of the new state.
[Browsable(false)]
public event HighlightedStateEventHandler HighlightedStateChanged