Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IScrollAnchorInfo.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 
4 using SiliconStudio.Core.Mathematics;
5 using SiliconStudio.Paradox.UI.Controls;
6 
7 namespace SiliconStudio.Paradox.UI
8 {
9  /// <summary>
10  /// Interface providing anchor information to its <see cref="ScrollViewer"/>.
11  /// </summary>
12  public interface IScrollAnchorInfo
13  {
14  /// <summary>
15  /// Indicate whether the <see cref="ScrollViewer"/> managing this element should snap scrolling to anchors in the provided direction.
16  /// </summary>
17  /// <param name="direction">The direction in which to anchor</param>
18  bool ShouldAnchor(Orientation direction);
19 
20  /// <summary>
21  /// Get the distances to the previous and next anchors in the provided direction and from given position.
22  /// </summary>
23  /// <param name="position">The current scrolling position</param>
24  /// <param name="direction">The direction in which to anchor</param>
25  /// <remarks>The distance contained in the X component of the returned vector is inferior or equal to 0
26  /// and the distance contained in the Y component is superior or equal to 0.</remarks>
27  /// <returns>The distances to previous and next anchors from to current scroll position</returns>
28  Vector2 GetSurroudingAnchorDistances(Orientation direction, float position);
29 
30  /// <summary>
31  /// Gets or sets a <see cref="ScrollViewer"/> element that controls scrolling behavior.
32  /// </summary>
33  ScrollViewer ScrollOwner { get; set; }
34  }
35 }
Represents a two dimensional mathematical vector.
Definition: Vector2.cs:42
Orientation
Defines the different orientations that a control or layout can have.
Definition: Orientation.cs:8
Interface providing anchor information to its ScrollViewer.
Represents a scroll viewer. A scroll viewer element has an infinite virtual size defined by its Scrol...
Definition: ScrollViewer.cs:19