protected override void SetBaseVisualElement(VisualElement visualElement) { VisualElement choseShapeField = new ChoseShapeDataField <ShapeData>( ShapeAction.ShapeDataFactory, ShapeAction, "Chose Shape: ", () => ShapeAction.ShapeData, shapeData => ShapeAction.SetShapeData(shapeData)); visualElement.Add(choseShapeField); Toggle setActiveField = new Toggle("Set Active: ") { value = ShapeAction.Active }; setActiveField.RegisterCallback <ChangeEvent <bool> >(evt => ShapeAction.SetIsActive(evt.newValue)); visualElement.Add(setActiveField); }
protected override void SetBaseVisualElement(VisualElement visualElement) { VisualElement choseShapeField = new ChoseShapeDataField <ShapeData>( ShapeAction.ShapeDataFactory, ShapeAction, "Chose Shape: ", () => ShapeAction.ShapeData, shapeData => ShapeAction.SetShapeData(shapeData)); visualElement.Add(choseShapeField); EnumField highlightField = new EnumField("Set Highlight") { value = ShapeAction.Highlight }; highlightField.Init(ShapeAction.Highlight); highlightField.RegisterCallback <ChangeEvent <Enum> >(evt => ShapeAction.SetHighlightType((HighlightType)evt.newValue)); visualElement.Add(highlightField); }