Browse Source

Added TileBrush.TileMode.

pull/111/head
Steven Kirk 11 years ago
parent
commit
eccfb11163
  1. 54
      src/Perspex.SceneGraph/Media/TileBrush.cs

54
src/Perspex.SceneGraph/Media/TileBrush.cs

@ -6,6 +6,37 @@
namespace Perspex.Media
{
/// <summary>
/// Describes how a <see cref="TileBrush"/> is tiled.
/// </summary>
public enum TileMode
{
/// <summary>
/// A single repeat of the content will be displayed.
/// </summary>
None,
/// <summary>
/// The content will be repeated horizontally, with alternate tiles mirrored.
/// </summary>
FlipX,
/// <summary>
/// The content will be repeated vertically, with alternate tiles mirrored.
/// </summary>
FlipY,
/// <summary>
/// The content will be repeated horizontally and vertically, with alternate tiles mirrored.
/// </summary>
FlipXY,
/// <summary>
/// The content will be repeated.
/// </summary>
Tile
}
/// <summary>
/// Base class for brushes which display repeating images.
/// </summary>
@ -15,25 +46,25 @@ namespace Perspex.Media
/// Defines the <see cref="AlignmentX"/> property.
/// </summary>
public static readonly PerspexProperty<AlignmentX> AlignmentXProperty =
PerspexProperty.Register<TileBrush, AlignmentX>("ALignmentX", AlignmentX.Center);
PerspexProperty.Register<TileBrush, AlignmentX>(nameof(AlignmentX), AlignmentX.Center);
/// <summary>
/// Defines the <see cref="AlignmentY"/> property.
/// </summary>
public static readonly PerspexProperty<AlignmentY> AlignmentYProperty =
PerspexProperty.Register<TileBrush, AlignmentY>("ALignmentY", AlignmentY.Center);
PerspexProperty.Register<TileBrush, AlignmentY>(nameof(AlignmentY), AlignmentY.Center);
/// <summary>
/// Defines the <see cref="DestinationRect"/> property.
/// </summary>
public static readonly PerspexProperty<RelativeRect> DestinationRectProperty =
PerspexProperty.Register<TileBrush, RelativeRect>("DestinationRect", RelativeRect.Fill);
PerspexProperty.Register<TileBrush, RelativeRect>(nameof(DestinationRect), RelativeRect.Fill);
/// <summary>
/// Defines the <see cref="SourceRect"/> property.
/// </summary>
public static readonly PerspexProperty<RelativeRect> SourceRectProperty =
PerspexProperty.Register<TileBrush, RelativeRect>("SourceRect", RelativeRect.Fill);
PerspexProperty.Register<TileBrush, RelativeRect>(nameof(SourceRect), RelativeRect.Fill);
/// <summary>
/// Defines the <see cref="Stretch"/> property.
@ -41,6 +72,12 @@ namespace Perspex.Media
public static readonly PerspexProperty<Stretch> StretchProperty =
PerspexProperty.Register<TileBrush, Stretch>(nameof(Stretch), Stretch.Uniform);
/// <summary>
/// Defines the <see cref="TileMode"/> property.
/// </summary>
public static readonly PerspexProperty<TileMode> TileModeProperty =
PerspexProperty.Register<TileBrush, TileMode>(nameof(TileMode));
/// <summary>
/// Gets or sets the horizontal alignment of a tile in the destination.
/// </summary>
@ -86,5 +123,14 @@ namespace Perspex.Media
get { return (Stretch)this.GetValue(StretchProperty); }
set { this.SetValue(StretchProperty, value); }
}
/// <summary>
/// Gets or sets the brush's tile mode.
/// </summary>
public TileMode TileMode
{
get { return (TileMode)this.GetValue(TileModeProperty); }
set { this.SetValue(TileModeProperty, value); }
}
}
}

Loading…
Cancel
Save