committed by
GitHub
26 changed files with 396 additions and 39 deletions
@ -1,15 +0,0 @@ |
|||
using Avalonia.Data; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Avalonia.Data.Core |
|||
{ |
|||
interface ISettableNode |
|||
{ |
|||
bool SetTargetValue(object value, BindingPriority priority); |
|||
Type PropertyType { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using Avalonia.Data; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Avalonia.Data.Core |
|||
{ |
|||
internal abstract class SettableNode : ExpressionNode |
|||
{ |
|||
public bool SetTargetValue(object value, BindingPriority priority) |
|||
{ |
|||
if (ShouldNotSet(value)) |
|||
{ |
|||
return true; |
|||
} |
|||
return SetTargetValueCore(value, priority); |
|||
} |
|||
|
|||
private bool ShouldNotSet(object value) |
|||
{ |
|||
if (PropertyType == null) |
|||
{ |
|||
return false; |
|||
} |
|||
if (PropertyType.IsValueType) |
|||
{ |
|||
return LastValue?.Target != null && LastValue.Target.Equals(value); |
|||
} |
|||
return LastValue != null && Object.ReferenceEquals(LastValue?.Target, value); |
|||
} |
|||
|
|||
protected abstract bool SetTargetValueCore(object value, BindingPriority priority); |
|||
|
|||
public abstract Type PropertyType { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
// 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.Controls.Primitives |
|||
{ |
|||
/// <summary>
|
|||
/// Specifies the type of Avalonia.Controls.Primitives.ScrollBar.Scroll event
|
|||
/// that occurred.
|
|||
/// </summary>
|
|||
public enum ScrollEventType |
|||
{ |
|||
/// <summary>
|
|||
/// Specifies that the Avalonia.Controls.Primitives.Thumb moved a specified
|
|||
/// distance, as determined by the value of Avalonia.Controls.Primitives.RangeBase.SmallChange.
|
|||
/// The Avalonia.Controls.Primitives.Thumb moved to the left for a horizontal
|
|||
/// Avalonia.Controls.Primitives.ScrollBar or upward for a vertical Avalonia.Controls.Primitives.ScrollBar.
|
|||
/// </summary>
|
|||
SmallDecrement = 0, |
|||
/// <summary>
|
|||
/// Specifies that the Avalonia.Controls.Primitives.Thumb moved a specified
|
|||
/// distance, as determined by the value of Avalonia.Controls.Primitives.RangeBase.SmallChange.
|
|||
/// The Avalonia.Controls.Primitives.Thumb moved to the right for a horizontal
|
|||
/// Avalonia.Controls.Primitives.ScrollBar or downward for a vertical Avalonia.Controls.Primitives.ScrollBar.
|
|||
/// </summary>
|
|||
SmallIncrement = 1, |
|||
/// <summary>
|
|||
/// Specifies that the Avalonia.Controls.Primitives.Thumb moved a specified
|
|||
/// distance, as determined by the value of Avalonia.Controls.Primitives.RangeBase.LargeChange.
|
|||
/// The Avalonia.Controls.Primitives.Thumb moved to the left for a horizontal
|
|||
/// Avalonia.Controls.Primitives.ScrollBar or upward for a vertical Avalonia.Controls.Primitives.ScrollBar.
|
|||
/// </summary>
|
|||
LargeDecrement = 2, |
|||
/// <summary>
|
|||
/// Specifies that the Avalonia.Controls.Primitives.Thumb moved a specified
|
|||
/// distance, as determined by the value of Avalonia.Controls.Primitives.RangeBase.LargeChange.
|
|||
/// The Avalonia.Controls.Primitives.Thumb moved to the right for a horizontal
|
|||
/// Avalonia.Controls.Primitives.ScrollBar or downward for a vertical Avalonia.Controls.Primitives.ScrollBar.
|
|||
/// </summary>
|
|||
LargeIncrement = 3, |
|||
/// <summary>
|
|||
/// The Avalonia.Controls.Primitives.Thumb was dragged and caused a Avalonia.UIElement.MouseMove
|
|||
/// event. A Avalonia.Controls.Primitives.ScrollBar.Scroll event of this Avalonia.Controls.Primitives.ScrollEventType
|
|||
/// may occur more than one time when the Avalonia.Controls.Primitives.Thumb
|
|||
/// is dragged in the Avalonia.Controls.Primitives.ScrollBar.
|
|||
/// </summary>
|
|||
ThumbTrack = 4, |
|||
/// <summary>
|
|||
/// Specifies that the Avalonia.Controls.Primitives.Thumb was dragged to a
|
|||
/// new position and is now no longer being dragged by the user.
|
|||
/// </summary>
|
|||
EndScroll = 5 |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
// 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.
|
|||
|
|||
using System; |
|||
|
|||
namespace Avalonia.Rendering |
|||
{ |
|||
/// <summary>
|
|||
/// Defines the interface for a renderer factory.
|
|||
/// </summary>
|
|||
public interface IRendererFactory |
|||
{ |
|||
/// <summary>
|
|||
/// Creates a renderer.
|
|||
/// </summary>
|
|||
/// <param name="root">The root visual.</param>
|
|||
/// <param name="renderLoop">The render loop.</param>
|
|||
IRenderer Create(IRenderRoot root, IRenderLoop renderLoop); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue