using FasdDesktopUi.Basics.Models;
using FasdDesktopUi.Basics.UiActions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace FasdDesktopUi.Basics.CustomEvents
{
    internal class CustomEventManager
    {
        public delegate void IndexChangedHandlerDelegate(object sender, IndexEventArgs args);

        public static readonly RoutedEvent IndexChangedEvent = EventManager.RegisterRoutedEvent("IndexChanged", RoutingStrategy.Bubble, typeof(IndexChangedHandlerDelegate), typeof(UIElement));

        public static void RaiseIndexChangedEvent(UIElement uiElement, int oldValue = -1, int newValue = -1)
        {
            uiElement.RaiseEvent(new IndexEventArgs(IndexChangedEvent) { OldValue = oldValue, NewValue = newValue });
        }

        public delegate void MenuDataChangedHandlerDelegate(object sender, MenuDataEventArgs args);

        public static readonly RoutedEvent MenuDataChangedEvent = EventManager.RegisterRoutedEvent("MenuDataChanged", RoutingStrategy.Bubble, typeof(MenuDataChangedHandlerDelegate), typeof(UIElement));

        public static void RaiseMenuDataChangedEvent(UIElement uIElement, cMenuDataBase menuData)
        {
            uIElement.RaiseEvent(new MenuDataEventArgs(MenuDataChangedEvent) { MenuData = menuData });
        }
    }
}
