using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.UI;

namespace Telerik.WinControls.UI
{
    public class RadMouseOverCursorBehavior : PropertyChangeBehavior
    {
        private Cursor normalCursor;
        private Cursor hoveredCursor;

        public RadMouseOverCursorBehavior(Cursor normalCursor, Cursor hoveredCursor)
            : base(RadItem.IsMouseOverProperty)
        {
            this.normalCursor = normalCursor;
            this.hoveredCursor = hoveredCursor;
        }        

        public override void OnPropertyChange(RadElement element, RadPropertyChangedEventArgs e)
        {
            if ((bool)e.NewValue)
            {
                element.ElementTree.Control.Cursor = hoveredCursor;
            }
            else
            {
                element.ElementTree.Control.Cursor = normalCursor;
            }
        }
    }
}
