blob: bb9dc08f4b6f18396eeb35398886883b9f63b4b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using System;
namespace Xamarin.Forms
{
public abstract class TriggerAction
{
internal TriggerAction(Type associatedType)
{
if (associatedType == null)
throw new ArgumentNullException("associatedType");
AssociatedType = associatedType;
}
protected Type AssociatedType { get; private set; }
protected abstract void Invoke(object sender);
internal virtual void DoInvoke(object sender)
{
Invoke(sender);
}
}
public abstract class TriggerAction<T> : TriggerAction where T : BindableObject
{
protected TriggerAction() : base(typeof(T))
{
}
protected override void Invoke(object sender)
{
Invoke((T)sender);
}
protected abstract void Invoke(T sender);
}
}
|