/// <inheritdoc /> public override void Initialize(LayoutElementsContainer layout) { _element = null; // Try get limit attribute for value min/max range setting and slider speed var attributes = Values.GetAttributes(); if (attributes != null) { var limit = attributes.FirstOrDefault(x => x is LimitAttribute); if (limit != null) { // Use double value editor with limit var doubleValue = layout.DoubleValue(); doubleValue.SetLimits((LimitAttribute)limit); doubleValue.DoubleValue.ValueChanged += OnValueChanged; doubleValue.DoubleValue.SlidingEnd += ClearToken; _element = doubleValue; return; } } if (_element == null) { // Use double value editor var doubleValue = layout.DoubleValue(); doubleValue.DoubleValue.ValueChanged += OnValueChanged; doubleValue.DoubleValue.SlidingEnd += ClearToken; _element = doubleValue; } }
/// <summary> /// Adds new double value element. /// </summary> /// <returns>The created element.</returns> public DoubleValueElement DoubleValue() { var element = new DoubleValueElement(); OnAddElement(element); return(element); }
/// <inheritdoc /> public override void Initialize(LayoutElementsContainer layout) { var grid = layout.CustomContainer <UniformGridPanel>(); var gridControl = grid.CustomControl; gridControl.ClipChildren = false; gridControl.Height = TextBox.DefaultHeight; gridControl.SlotsHorizontally = 2; gridControl.SlotsVertically = 1; LimitAttribute limit = null; var attributes = Values.GetAttributes(); if (attributes != null) { limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute); } XElement = grid.DoubleValue(); XElement.SetLimits(limit); XElement.ValueBox.ValueChanged += OnValueChanged; XElement.ValueBox.SlidingEnd += ClearToken; YElement = grid.DoubleValue(); YElement.SetLimits(limit); YElement.ValueBox.ValueChanged += OnValueChanged; YElement.ValueBox.SlidingEnd += ClearToken; }