/// <summary> /// Handles the change of the location, sets the new location and invokes the changed event. /// </summary> private void txtLocation_ValueChanged(VectorTextBox sender, TPoint newLocation) { var diff = newLocation - this.currentDefinition.Location; this.currentDefinition = (MouseSpeedIndicatorDefinition)this.currentDefinition.Translate(diff.Width, diff.Height); this.DefinitionChanged?.Invoke(this.currentDefinition); }
/// <summary> /// Handles the change of the location, sets the new location and invokes the changed event. /// </summary> private void txtSize_ValueChanged(VectorTextBox sender, TPoint newSize) { this.currentDefinition = this.currentDefinition.Resize(new Size(newSize.X, newSize.Y)); // Only allow reasonable values to be set. if (newSize.X >= 25 && newSize.Y >= 25 && newSize.X <= 4096 && newSize.Y <= 4096) { this.DefinitionChanged?.Invoke(this.currentDefinition); } }