blob: f104ba421691bbf8c10bc63064c5082bb0545e26 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
using ElmSharp;
namespace Xamarin.Forms.Platform.Tizen
{
/// <summary>
/// Base class for view renderers.
/// </summary>
public abstract class ViewRenderer<TView, TNativeView> : VisualElementRenderer<TView>
where TView : View
where TNativeView : EvasObject
{
GestureDetector _gestureDetector;
/// <summary>
/// Default constructor.
/// </summary>
protected ViewRenderer()
{
}
protected override void OnElementChanged(ElementChangedEventArgs<TView> e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
_gestureDetector.Clear();
_gestureDetector = null;
}
if (e.NewElement != null)
{
_gestureDetector = new GestureDetector(this);
}
}
/// <summary>
/// Native control associated with this renderer.
/// </summary>
public TNativeView Control
{
get
{
return (TNativeView)NativeView;
}
}
protected override void ApplyTransformation()
{
base.ApplyTransformation();
_gestureDetector?.UpdateHitBox();
}
}
}
|