MultiSelectEditorAttributeT Class |
Namespace: Demo3D.Gui.AspectViewer.Editors
public class MultiSelectEditorAttribute<T> : AspectEditorAttribute
[Missing <typeparam name="T"/> documentation for "T:Demo3D.Gui.AspectViewer.Editors.MultiSelectEditorAttribute`1"]
The MultiSelectEditorAttributeT type exposes the following members.
| Name | Description | |
|---|---|---|
| MultiSelectEditorAttributeT | Initializes a new instance of the MultiSelectEditorAttributeT class |
| Name | Description | |
|---|---|---|
| AllowedValues |
The collection of values to select from.
| |
| AllowedValuesPropertyLink |
The property that contains the collection of values to select from.
| |
| EditorName |
The name of the editor.
(Overrides AspectEditorAttribute.EditorName.) |
This example shows how to use both the AllowedValues and AllowedValuesPropertyLink attributes.
using Demo3D.Gui.AspectViewer; using Demo3D.Gui.AspectViewer.Editors; using Demo3D.Visuals; using System.Collections.ObjectModel; namespace ExamplesCSharp.Aspects.AspectEditors { public class MultiSelectExampleAspect : AspectComponentBase { private int[] multiSelectTest = [1]; // The contents of AllowedValues are displayed in the editor dropdown, which // can then be applied to the property. [MultiSelectEditor<int>(AllowedValues = [1, 2, 3, 4, 5])] public int[] MultiSelectTest { get => multiSelectTest; set => SetProperty(ref multiSelectTest, value); } // The contents of LinkedPropertySource are displayed in the editor dropdown of LinkedProperty. // By making it an ObservableCollection, the editor will update when the collection changes. [AspectProperty(IsVisible = false)] public ObservableCollection<int> LinkedPropertySource { get; } = [6, 7, 8, 9]; [MultiSelectEditor<int>(AllowedValuesPropertyLink = nameof(LinkedPropertySource))] public ObservableCollection<int> LinkedProperty { get; } = []; } }