private void InputContext_MouseMove(object sender, MouseEventArgs e) { if (!onDragging) { return; } float sideMargin = (float)BackLine.Margin.Left; float sliderWidth = (float)InputContext.ActualWidth - sideMargin * 2f; Point cursorPos = e.GetPosition(InputContext); float inputValue = Mathf.Clamp01(((float)cursorPos.X - sideMargin) / sliderWidth); Value = Mathf.Max(0, inputValue * (MaxValue - MinValue) + MinValue); EditableValueChanged?.Invoke(Value); }
private void ValueTextBox_Z_EditableValueChanged(object value) { EditableValueChanged?.Invoke(new UVector3(ValueTextBox_X.Value, ValueTextBox_Y.Value, ValueTextBox_Z.Value)); }