public sealed class IconA small piece of vector art, drawn in the current text colour or in colours of its own.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Two properties, and Art is the general one. Geometry is one path in the inherited colour, which is what an editor's chrome is; Art is several paths each with its own paint, which is what a file-type glyph needs and what a plugin declares for its own asset type. See IconArt.
A path rather than an image, because an icon is not a picture: it is drawn at whatever size the layout gives it, it changes colour with the text around it, and there are several hundred of them in an editor. A texture per icon per size per colour is how icon sets become the largest thing in a build.
⚠ The geometry is handed in rather than parsed from a string. There is no SVG path parser here, and that is a decision rather than an omission: an icon set is compiled content, so the place to turn "M12 2L2 22h20z" into segments is the asset pipeline, once, rather than every application at start-up. A PathBuilder is what comes out the other end, and it is what this takes.
ViewBox is what makes an icon set interchangeable. Geometry authored against a 24×24 grid is drawn into whatever box the layout produced, scaled uniformly and centred — so a 16-pixel toolbar and a 32-pixel button share one definition, and an icon drawn against a different grid says so instead of coming out the wrong size.
Fields and properties (10)
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 PathBuilder? Geometrypublic IconArt? Artpublic Rectangle ViewBoxpublic PathFillRule FillRulepublic static readonly UiPropertyKey GeometryPropertyIdentity for Geometry.
public static readonly UiPropertyKey ArtPropertyIdentity for Art.
public static readonly UiPropertyKey ViewBoxPropertyIdentity for ViewBox.
public static readonly UiPropertyKey FillRulePropertyIdentity for FillRule.
Methods (6)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
protected override void OnDraw(DrawContext context)public void ClearGeometry()Unsets Geometry, so it takes its default or its ancestor's value again.
public void ClearArt()Unsets Art, so it takes its default or its ancestor's value again.
public void ClearViewBox()Unsets ViewBox, so it takes its default or its ancestor's value again.
public void ClearFillRule()Unsets FillRule, so it takes its default or its ancestor's value again.
Used by (50, showing 40)
- AlertVixen.Ui.Controls
- BreadcrumbVixen.Ui.Controls
- ButtonBaseVixen.Ui.Controls
- ButtonTestsVixen.Ui.Controls.Tests
- CheckBoxVixen.Ui.Controls
- CodeEditorVixen.Ui.Controls.Advanced
- CodeGutterRowVixen.Ui.Controls.Advanced
- ColorPickerVixen.Ui.Controls.Advanced
- ComboBoxVixen.Ui.Controls
- DataGridVixen.Ui.Controls.Advanced
- DataHeaderCellVixen.Ui.Controls.Advanced
- DialogVixen.Ui.Controls
- DockGroupViewVixen.Ui.Controls.Advanced
- DockTabVixen.Ui.Controls.Advanced
- EmptyStateVixen.Ui.Controls
- ExpanderVixen.Ui.Controls
- ExpanderHeaderVixen.Ui.Controls
- IconArtTestsVixen.Ui.Controls.Tests
- MenuItemVixen.Ui.Controls
- MultiSelectVixen.Ui.Controls
- NavigationInteractionTestsVixen.Ui.Controls.Tests
- OptionVixen.Ui.Controls
- PaginationVixen.Ui.Controls
- PropertyRowVixen.Ui.Controls.Advanced
- SearchBoxVixen.Ui.Controls
- SelectBaseVixen.Ui.Controls
- SurfaceTestsVixen.Ui.Controls.Tests
- ToastVixen.Ui.Controls
- TreeRowVixen.Ui.Controls.Advanced
- TreeViewVixen.Ui.Controls.Advanced
- AddComponentMenuVixen.Editor.App
- AddComponentRowVixen.Editor.App
- AssetDrawerVixen.Editor.Inspector
- AssetGridVixen.Editor.App
- AssetTileVixen.Editor.App
- ComponentsViewVixen.Editor.App
- EditorAffordanceTestsVixen.Editor.App.Tests
- EditorApplicationVixen.Editor.App
- GridViewTestsVixen.Editor.App.Tests
- IconContributionTestsVixen.Editor.App.Tests