Click or drag to resize

MultiSelectEditorAttributeT Class

An editor that allows the user to select multiple values from a drop down.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    PropertyViewerEditorAttribute
      AspectEditorAttribute
        Demo3D.Gui.AspectViewer.EditorsMultiSelectEditorAttributeT

Namespace:  Demo3D.Gui.AspectViewer.Editors
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 18.04.00
Syntax
C#
public class MultiSelectEditorAttribute<T> : AspectEditorAttribute

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "T:Demo3D.Gui.AspectViewer.Editors.MultiSelectEditorAttribute`1"]

The MultiSelectEditorAttributeT type exposes the following members.

Constructors
  NameDescription
Public methodMultiSelectEditorAttributeT
Initializes a new instance of the MultiSelectEditorAttributeT class
Top
Properties
  NameDescription
Public propertyAllowedValues
The collection of values to select from.
Public propertyAllowedValuesPropertyLink
The property that contains the collection of values to select from.
Public propertyEditorName
The name of the editor.
(Overrides AspectEditorAttribute.EditorName.)
Top
Remarks
This editor can only be used on non-readonly collections. Values that are selected in the editor will be added to the collection in the order they are selected.
Examples

This example shows how to use both the AllowedValues and AllowedValuesPropertyLink attributes.

C#
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; } = [];
    }
}
See Also