private void Initialize() { Size = new Size(360.0f, 360.0f); sweepAngleAnimation?.Stop(); sweepAngleAnimation = null; trackVisual = new ArcVisual { SuppressUpdateVisual = true, Thickness = this.Thickness, Cap = ArcVisual.CapType.Butt, MixColor = TrackColor, StartAngle = 0.0f, SweepAngle = 360.0f }; this.AddVisual(TrackVisualName, trackVisual); progressVisual = new ArcVisual { SuppressUpdateVisual = true, Thickness = this.Thickness, Cap = ArcVisual.CapType.Butt, MixColor = ProgressColor, StartAngle = 0.0f, SweepAngle = 0.0f }; this.AddVisual(ProgressVisualName, progressVisual); HandleProgressVisualVisibility(); UpdateProgressVisualSweepAngle(); }
private void Initialize() { Size = new Size(360.0f, 360.0f); sweepAngleAnimation?.Stop(); sweepAngleAnimation = null; thumbAnimation?.Stop(); thumbAnimation = null; trackVisual = new ArcVisual { SuppressUpdateVisual = true, Size = new Size(this.Size.Width - sliderPadding, this.Size.Height - sliderPadding), SizePolicy = VisualTransformPolicyType.Absolute, Thickness = this.Thickness, Cap = ArcVisual.CapType.Butt, MixColor = TrackColor, StartAngle = 0.0f, SweepAngle = 360.0f }; this.AddVisual(TrackVisualName, trackVisual); progressVisual = new ArcVisual { SuppressUpdateVisual = true, Size = new Size(this.Size.Width - sliderPadding, this.Size.Height - sliderPadding), SizePolicy = VisualTransformPolicyType.Absolute, Thickness = this.Thickness, Cap = ArcVisual.CapType.Butt, MixColor = ProgressColor, StartAngle = 0.0f, SweepAngle = 0.0f }; this.AddVisual(ProgressVisualName, progressVisual); thumbVisual = new ArcVisual { SuppressUpdateVisual = true, Size = new Size(this.Size.Width + sliderPadding, this.Size.Height + sliderPadding), SizePolicy = VisualTransformPolicyType.Absolute, Thickness = this.ThumbSize.Width, Cap = ArcVisual.CapType.Round, MixColor = this.ThumbColor, StartAngle = 0.0f, SweepAngle = 0.0f }; this.AddVisual(ThumbVisualName, thumbVisual); HandleProgressVisualVisibility(); UpdateProgressVisualSweepAngle(); }
public void ArcVisualConstructor() { tlog.Debug(tag, $"ArcVisualConstructor START"); var testingTarget = new ArcVisual(); Assert.IsNotNull(testingTarget, "Can't create success object AnimatedImageVisual"); Assert.IsInstanceOf <ArcVisual>(testingTarget, "Should be an instance of ArcVisual type."); testingTarget.Dispose(); tlog.Debug(tag, $"ArcVisualConstructor END (OK)"); }
protected override void Dispose(DisposeTypes type) { if (disposed) { return; } if (type == DisposeTypes.Explicit) { trackVisual = null; progressVisual = null; } base.Dispose(type); }
public void ArcVisualStartAngle() { tlog.Debug(tag, $"ArcVisualStartAngle START"); var testingTarget = new ArcVisual(); Assert.IsNotNull(testingTarget, "Can't create success object ArcVisual"); Assert.IsInstanceOf <ArcVisual>(testingTarget, "Should be an instance of ArcVisual type."); testingTarget.StartAngle = 30.0f; var result = testingTarget.StartAngle; Assert.AreEqual(30.0f, result, "Retrived result should be equal to set value."); testingTarget.Dispose(); tlog.Debug(tag, $"ArcVisualStartAngle END (OK)"); }
public void ArcVisualCap() { tlog.Debug(tag, $"ArcVisualCap START"); var testingTarget = new ArcVisual(); Assert.IsNotNull(testingTarget, "Can't create success object ArcVisual"); Assert.IsInstanceOf <ArcVisual>(testingTarget, "Should be an instance of ArcVisual type."); testingTarget.Cap = ArcVisual.CapType.Butt; var result = testingTarget.Cap; Assert.AreEqual(ArcVisual.CapType.Butt, result, "Retrived result should be equal to set value."); testingTarget.Cap = ArcVisual.CapType.Round; result = testingTarget.Cap; Assert.AreEqual(ArcVisual.CapType.Round, result, "Retrived result should be equal to set value."); testingTarget.Dispose(); tlog.Debug(tag, $"ArcVisualCap END (OK)"); }