7aa32d76630d1f87cc303b88316c5845a41bfb63
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / XamlBinding / Interactivity / TriggerAction.cs
1 using System;
2
3 namespace Tizen.NUI.Binding
4 {
5     internal abstract class TriggerAction
6     {
7         internal TriggerAction(Type associatedType)
8         {
9             if (associatedType == null)
10                 throw new ArgumentNullException("associatedType");
11             AssociatedType = associatedType;
12         }
13
14         protected Type AssociatedType { get; private set; }
15
16         protected abstract void Invoke(object sender);
17
18         internal virtual void DoInvoke(object sender)
19         {
20             Invoke(sender);
21         }
22     }
23
24     internal abstract class TriggerAction<T> : TriggerAction where T : BindableObject
25     {
26         protected TriggerAction() : base(typeof(T))
27         {
28         }
29
30         protected override void Invoke(object sender)
31         {
32             Invoke((T)sender);
33         }
34
35         protected abstract void Invoke(T sender);
36     }
37 }