// This source file is adapted from the WinUI project.
// (https://github.com/microsoft/microsoft-ui-xaml)
//
// Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation.
using System;
namespace Avalonia.Controls
{
///
/// Provides data for the event.
///
public class ItemsRepeaterElementIndexChangedEventArgs : EventArgs
{
internal ItemsRepeaterElementIndexChangedEventArgs(IControl element, int oldIndex, int newIndex)
{
Element = element;
OldIndex = oldIndex;
NewIndex = newIndex;
}
///
/// Get the element for which the index changed.
///
public IControl Element { get; private set; }
///
/// Gets the index of the element after the change.
///
public int NewIndex { get; private set; }
///
/// Gets the index of the element before the change.
///
public int OldIndex { get; private set; }
internal void Update(IControl element, int newIndex, int oldIndex)
{
Element = element;
NewIndex = newIndex;
OldIndex = oldIndex;
}
}
}