csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
// Copyright (c) The Avalonia Project. All rights reserved.
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
namespace Avalonia.Media
|
|
{
|
|
/// <summary>
|
|
/// A brush that draws with a linear gradient.
|
|
/// </summary>
|
|
public sealed class LinearGradientBrush : GradientBrush
|
|
{
|
|
/// <summary>
|
|
/// Defines the <see cref="StartPoint"/> property.
|
|
/// </summary>
|
|
public static readonly StyledProperty<RelativePoint> StartPointProperty =
|
|
AvaloniaProperty.Register<LinearGradientBrush, RelativePoint>(
|
|
nameof(StartPoint),
|
|
RelativePoint.TopLeft);
|
|
|
|
/// <summary>
|
|
/// Defines the <see cref="EndPoint"/> property.
|
|
/// </summary>
|
|
public static readonly StyledProperty<RelativePoint> EndPointProperty =
|
|
AvaloniaProperty.Register<LinearGradientBrush, RelativePoint>(
|
|
nameof(EndPoint),
|
|
RelativePoint.BottomRight);
|
|
|
|
/// <summary>
|
|
/// Gets or sets the start point for the gradient.
|
|
/// </summary>
|
|
public RelativePoint StartPoint
|
|
{
|
|
get { return GetValue(StartPointProperty); }
|
|
set { SetValue(StartPointProperty, value); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the end point for the gradient.
|
|
/// </summary>
|
|
public RelativePoint EndPoint
|
|
{
|
|
get { return GetValue(EndPointProperty); }
|
|
set { SetValue(EndPointProperty, value); }
|
|
}
|
|
}
|
|
}
|