public sealed class GradientEditorEditing a gradient: two rails of stops, a bar, and a picker for whichever is selected.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ Two rails because there are two lists. Colour and alpha are edited separately — see Gradient for why they are stored separately — so the alpha stops sit above the bar and the colour stops below it, which is the arrangement every tool that made the same choice arrived at.
The picker is part of the control rather than something an application wires up. Selecting a colour stop and then having to find where its colour is edited is the whole friction of a gradient editor, and a picker that appears where the selection is removes it. An application that wants its own puts Picker's class in display: none and listens to SelectionChanged.
Fields and properties (11)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public Gradient GradientThe gradient being edited.
public GradientRail AlphaRailThe rail of alpha stops, above the bar.
public GradientBar BarThe strip.
public GradientRail ColorRailThe rail of colour stops, below it.
public Select SpaceHow the colours are mixed.
public ColorPicker PickerThe picker, shown when a colour stop is selected.
public Slider OpacityThe opacity slider, shown when an alpha stop is selected.
public GradientColorStop? SelectedColorStopWhich colour stop is selected, if one is.
public GradientAlphaStop? SelectedAlphaStopWhich alpha stop is selected, if one is.
Events (2)
public Action<GradientEditor>? GradientChangedRaised after the gradient changes.
public Action<GradientEditor>? SelectionChangedRaised when a different stop is selected.
Methods (7)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public void Select(GradientColorStop? stop)Selects a colour stop, and shows the picker for it.
public void Select(GradientAlphaStop? stop)Selects an alpha stop, and shows the opacity slider for it.
public float ToScreen(float position)Where a position along the gradient is, in document space.
public float ToPosition(float x)Which position along the gradient a document-space x is.
public GradientColorStop? ColorStopAt(float x, float radius = 9)The colour stop nearest a point on the colour rail, if one is within reach.
public GradientAlphaStop? AlphaStopAt(float x, float radius = 9)The alpha stop nearest a point on the alpha rail, if one is within reach.
Used by (3)
- GradientBarVixen.Ui.Controls.Advanced
- GradientEditorTestsVixen.Ui.Controls.Advanced.Tests
- GradientRailVixen.Ui.Controls.Advanced