8 changed files with 216 additions and 28 deletions
@ -0,0 +1,84 @@ |
|||||
|
namespace Perspex.Media |
||||
|
{ |
||||
|
using Perspex.Animation; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
public class DashStyle : Animatable |
||||
|
{ |
||||
|
private static DashStyle dash; |
||||
|
public static DashStyle Dash |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if (dashDotDot == null) |
||||
|
{ |
||||
|
dash = new DashStyle(new double[] { 2, 2 }, 1); |
||||
|
} |
||||
|
|
||||
|
return dash; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
private static DashStyle dot; |
||||
|
public static DashStyle Dot |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if (dot == null) |
||||
|
{ |
||||
|
dot = new DashStyle(new double[] { 0, 2 }, 0); |
||||
|
} |
||||
|
|
||||
|
return dot; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private static DashStyle dashDot; |
||||
|
public static DashStyle DashDot |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if (dashDot == null) |
||||
|
{ |
||||
|
dashDot = new DashStyle(new double[] { 2, 2, 0, 2 }, 1); |
||||
|
} |
||||
|
|
||||
|
return dashDot; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private static DashStyle dashDotDot; |
||||
|
public static DashStyle DashDotDot |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if (dashDotDot == null) |
||||
|
{ |
||||
|
dashDotDot = new DashStyle(new double[] { 2, 2, 0, 2, 0, 2 }, 1); |
||||
|
} |
||||
|
|
||||
|
return dashDotDot; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public DashStyle(IReadOnlyList<double> dashes = null, double offset = 0.0) |
||||
|
{ |
||||
|
this.Dashes = dashes; |
||||
|
this.Offset = offset; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets and sets the length of alternating dashes and gaps.
|
||||
|
/// </summary>
|
||||
|
public IReadOnlyList<double> Dashes { get; } |
||||
|
|
||||
|
public double Offset { get; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Perspex.Media |
||||
|
{ |
||||
|
public enum PenLineCap |
||||
|
{ |
||||
|
Flat, |
||||
|
Round, |
||||
|
Square, |
||||
|
Triangle |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Perspex.Media |
||||
|
{ |
||||
|
public enum PenLineJoin |
||||
|
{ |
||||
|
Bevel, |
||||
|
Miter, |
||||
|
Round |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue