/// <summary> /// Initialize this instance. /// </summary> public void Initialize() { // Wire-up events GradientName.EditingEnded += (sender, e) => { // Save undo point DesignSurface.SaveUndoPoint(); // Save and validate SelectedGradient.Name = GradientName.StringValue; DesignSurface.Portfolio.EnsureGradientNameIsValid(SelectedGradient); // Update UI GradientName.StringValue = SelectedGradient.Name; RaiseGradientModified(SelectedGradient); }; DesignBar.HandleSelected += (handle) => { // Update color information ShowCurrentColor(); }; DesignPreview.GradientModified += () => { // Update shape RaiseShapeModified(); }; }
/// <summary> /// Handles the skip points number changing. /// </summary> /// <param name="sender">Sender.</param> partial void SkipChanged(Foundation.NSObject sender) { DesignSurface.SaveUndoPoint(); SelectedShape.SkipPoints = SkipSlider.IntValue; SkipValue.StringValue = SkipSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the font weight changing. /// </summary> /// <param name="sender">Sender.</param> partial void WeightChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Set new value switch (WeightDropdown.IndexOfSelectedItem) { case 0: SelectedStyle.TypefaceStyle = SKTypefaceStyle.Normal; break; case 1: SelectedStyle.TypefaceStyle = SKTypefaceStyle.Bold; break; case 2: SelectedStyle.TypefaceStyle = SKTypefaceStyle.BoldItalic; break; case 3: SelectedStyle.TypefaceStyle = SKTypefaceStyle.Italic; break; } RaiseShapeModified(); }
/// <summary> /// Does the canvas include a colored background? /// </summary> /// <param name="sender">Sender.</param> partial void HasCanvasColorChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedSketch.DrawCanvas = (CanvasColorCheckbox.IntValue == 1); }
/// <summary> /// Handles the tile mode changing. /// </summary> /// <param name="sender">Sender.</param> partial void TileChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Take action based on the selected type switch (TileDropdown.IndexOfSelectedItem) { case 0: SelectedGradient.TileMode = SKShaderTileMode.Clamp; break; case 1: SelectedGradient.TileMode = SKShaderTileMode.Repeat; break; case 2: SelectedGradient.TileMode = SKShaderTileMode.Mirror; break; } // Update UI RaiseGradientModified(SelectedGradient); RaiseShapeModified(); }
/// <summary> /// Handles the rotation being changed. /// </summary> /// <param name="sender">Sender.</param> partial void RotationChanged(Foundation.NSObject sender) { DesignSurface.SaveUndoPoint(); SelectedShape.RotationDegrees = RotationSlider.IntValue; RotationValue.StringValue = RotationSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the number of sides changing. /// </summary> /// <param name="sender">Sender.</param> partial void SidesChanged(Foundation.NSObject sender) { DesignSurface.SaveUndoPoint(); SelectedShape.NumberOfSides = SidesSlider.IntValue; SidesValue.StringValue = SidesSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Duplicates the point. /// </summary> /// <param name="sender">Sender.</param> partial void DuplicatePoint(Foundation.NSObject sender) { var pointCount = 0; // Save undo point DesignSurface.SaveUndoPoint(); // Take action based on shape type if (SelectedShape is KimonoShapeVector) { var vector = SelectedShape as KimonoShapeVector; vector.DuplicateSelectedPoint(); pointCount = vector.Points.Count; } else if (SelectedShape is KimonoShapeBezier) { var bezier = SelectedShape as KimonoShapeBezier; bezier.DuplicateSelectedPoint(); pointCount = bezier.Points.Count; } // Update UI DuplicateButton.Enabled = (SelectedShape.State == KimonoShapeState.Editing && SelectedShape.HitHandle != null); DeleteButton.Enabled = (DuplicateButton.Enabled && pointCount > 3); RaiseShapeModified(); }
/// <summary> /// Handles the boolean operation changing. /// </summary> /// <param name="sender">Sender.</param> partial void OperationChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Save new value switch (Operation.IndexOfSelectedItem) { case 0: SelectedGroup.BooleanOperation = SKPathOp.Union; break; case 1: SelectedGroup.BooleanOperation = SKPathOp.Intersect; break; case 2: SelectedGroup.BooleanOperation = SKPathOp.Difference; break; case 3: SelectedGroup.BooleanOperation = SKPathOp.ReverseDifference; break; case 4: SelectedGroup.BooleanOperation = SKPathOp.Xor; break; } // Update UI RaiseGroupModified(SelectedGroup); }
/// <summary> /// Handles the point depth value chainging. /// </summary> /// <param name="sender">Sender.</param> partial void DepthChanged(Foundation.NSObject sender) { DesignSurface.SaveUndoPoint(); SelectedShape.DepthOffset = DepthSlider.IntValue; DepthValue.StringValue = DepthSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the gradient's type changing. /// </summary> /// <param name="sender">Sender.</param> partial void TypeChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Take action based on the selected type switch (TypeDropdown.IndexOfSelectedItem) { case 0: SelectedGradient.GradientType = KimonoGradientType.LinearGradient; break; case 1: SelectedGradient.GradientType = KimonoGradientType.RadialGradient; break; case 2: SelectedGradient.GradientType = KimonoGradientType.SweepGradient; break; case 3: SelectedGradient.GradientType = KimonoGradientType.ConicalGradient; break; } // Update UI TileDropdown.Enabled = (SelectedGradient.GradientType != KimonoGradientType.SweepGradient); RadiusSlider.Enabled = (SelectedGradient.GradientType == KimonoGradientType.RadialGradient || SelectedGradient.GradientType == KimonoGradientType.ConicalGradient); RaiseGradientModified(SelectedGradient); RaiseShapeModified(); }
/// <summary> /// Handles the streamline value changing. /// </summary> /// <param name="sender">Sender.</param> partial void StreamlinedChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedShape.IsStreamlined = (StreamlinedCheckbox.IntValue == 1); RaiseShapeModified(); }
/// <summary> /// Handles the vertical text changing. /// </summary> /// <param name="sender">Sender.</param> partial void VerticalChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.IsVerticalText = (VerticalCheckbox.IntValue == 1); RaiseShapeModified(); }
/// <summary> /// Handles the has tail value changing. /// </summary> /// <param name="sender">Sender.</param> partial void TailChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedShape.HasEndHead = (TailCheckbox.IntValue == 1); RaiseShapeModified(); }
/// <summary> /// Handles the antialias changing. /// </summary> /// <param name="sender">Sender.</param> partial void AntialiasChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.Frame.IsAntialias = (AntialiasCheckbox.IntValue == 1); RaiseShapeModified(); }
/// <summary> /// Duplicates the property. /// </summary> /// <param name="sender">Sender.</param> partial void DuplicateProperty(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Update the UI RaiseRequestDuplicateProperty(); }
/// <summary> /// Handles the jitter deviation changing. /// </summary> /// <param name="sender">Sender.</param> partial void DeviationChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.FrameJitterDeviation = DeviationSlider.FloatValue; DeviationValue.StringValue = DeviationSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the jitter lenght changing. /// </summary> /// <param name="sender">Sender.</param> partial void LengthChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.FrameJitterLength = LengthSlider.FloatValue; LengthValue.StringValue = LengthSlider.IntValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the size changing. /// </summary> /// <param name="sender">Sender.</param> partial void SizeChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Save changes SelectedStyle.TextSize = Size.FloatValue; RaiseShapeModified(); }
/// <summary> /// Handles the skew changing. /// </summary> /// <param name="sender">Sender.</param> partial void SkewChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.TextSkewX = SkewSlider.FloatValue; SkewValue.StringValue = SkewSlider.FloatValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Adjusts the saturation changed. /// </summary> /// <param name="sender">Sender.</param> partial void AdjustSaturationChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedColor.AdjustsSaturation = (AdjustSaturationCheckbox.IntValue == 1); SetColorValues(); RaiseColorModified(SelectedColor); }
/// <summary> /// Handles the opacity changing. /// </summary> /// <param name="sender">Sender.</param> partial void OpacityChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedColor.AlphaAdjustment = OpacitySlider.IntValue; SetColorValues(); RaiseColorModified(SelectedColor); }
/// <summary> /// Handles the saturation changing. /// </summary> /// <param name="sender">Sender.</param> partial void SaturationChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedColor.SaturationAdjustment = SaturationSlider.FloatValue; SetColorValues(); RaiseColorModified(SelectedColor); }
/// <summary> /// Handles the Miter changing. /// </summary> /// <param name="sender">Sender.</param> partial void MiterChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.Frame.StrokeMiter = MiterSlider.FloatValue; MiterValue.StringValue = MiterSlider.FloatValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the inner value changing. /// </summary> /// <param name="sender">Sender.</param> partial void InnerChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedShape.HeadInnerRatio = InnerSlider.FloatValue; InnerValue.StringValue = InnerSlider.FloatValue.ToString(); RaiseShapeModified(); }
/// <summary> /// Handles the typeface changing. /// </summary> /// <param name="sender">Sender.</param> partial void TypefaceChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Save changes SelectedStyle.FontFamilyName = TypefaceDropdown.SelectedItem.Title; RaiseShapeModified(); }
/// <summary> /// Handles a dash point changing. /// </summary> /// <param name="sender">Sender.</param> partial void DashChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.HasFrameDash = (DashCheckbox.IntValue == 1); ShowDashEditor(); RaiseShapeModified(); }
/// <summary> /// Handles the jitter effect changing. /// </summary> /// <param name="sender">Sender.</param> partial void JitterChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.HasFrameJitter = (JitterCheckbox.IntValue == 1); LengthSlider.Enabled = SelectedStyle.HasFrameJitter; DeviationSlider.Enabled = SelectedStyle.HasFrameJitter; RaiseShapeModified(); }
/// <summary> /// Handles a dash point changing. /// </summary> /// <param name="sender">Sender.</param> partial void Dash16Changed(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); SelectedStyle.DashPattern[15] = !SelectedStyle.DashPattern[15]; SelectedStyle.ApplyFrameEffects(); ShowDashEditor(); RaiseShapeModified(); }
/// <summary> /// Handles the mask changing. /// </summary> /// <param name="sender">Sender.</param> partial void MaskChanged(Foundation.NSObject sender) { // Save undo point DesignSurface.SaveUndoPoint(); // Save the new value SelectedGroup.IsMaskedGroup = (MaskCheckbox.IntValue == 1); // Update UI RaiseGroupModified(SelectedGroup); }