﻿using System.Windows.Controls;
using System.Windows.Interactivity;
using GalaSoft.MvvmLight.Messaging;
using KMBEditor.PresentationLayer.Editor.View.Message;

namespace KMBEditor.PresentationLayer.Editor.View.Behavior
{
    public class GetEditTextBoxMessageTriger : TriggerBase<TextBox>
    {
        protected override void OnAttached()
        {
            base.OnAttached();
            Messenger.Default.Register<GetEditTextBoxMessage>(AssociatedObject, InvokeActions);
        }

        protected override void OnDetaching()
        {
            Messenger.Default.Unregister<GetEditTextBoxMessage>(AssociatedObject);
            base.OnDetaching();
        }
    }
}