private void TextBlock_MouseMove(object sender, MouseEventArgs e) { if (_mouseDown) { double x = e.GetPosition(null).X; curValue += (float)(x - _mouseXpos) / 10.0f; if (operatTitle == 0) { vec.x = curValue; } else if (operatTitle == 1) { vec.y = curValue; } else if (operatTitle == 2) { vec.z = curValue; } EnterKeyDown?.Invoke(this, null); if (SelectObject != null) { ValueProperty.SetValue(SelectObject, vec); } _mouseXpos = x; } }
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ #region --Constructors-- #endregion //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ #region --Set-, Get- Methods-- #endregion //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- #endregion #region --Misc Methods (Private)-- #endregion #region --Misc Methods (Protected)-- #endregion //--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- protected override void OnKeyDown(KeyRoutedEventArgs e) { if (e.Key == VirtualKey.Enter) { EnterKeyDown?.Invoke(this, e); if (e.Handled) { return; } } base.OnKeyDown(e); }
private void _PreviewKeyUp(object sender, KeyEventArgs e) { if (Key.Enter != e.Key) { return; } vec.x = X; vec.y = Y; vec.z = Z; EnterKeyDown?.Invoke(this, e); if (SelectObject != null) { ValueProperty.SetValue(SelectObject, vec); } }