-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBehaviour.cs
More file actions
31 lines (27 loc) · 1.11 KB
/
TestBehaviour.cs
File metadata and controls
31 lines (27 loc) · 1.11 KB
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
#if IOS
using PlatformView = UIKit.UIView;
#elif MACOS
using PlatformView = AppKit.NSView;
#elif ANDROID
using PlatformView = Android.Views.View;
#elif WINDOWS
using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
#elif TIZEN
using PlatformView = Tizen.NUI.BaseComponents.View;
#elif NET6_0_OR_GREATER || (NETSTANDARD || !PLATFORM)
using PlatformView = System.Object;
#endif
namespace BehaviourInitTwice;
public class TestBehaviour : PlatformBehavior<VisualElement, PlatformView>
{
protected override void OnAttachedTo(VisualElement bindable, PlatformView platformView)
{
Console.WriteLine($"==================================== OnAttachedTo({bindable.GetType().Name}, {platformView.GetType().Name}):\n{Environment.StackTrace}");
base.OnAttachedTo(bindable, platformView);
}
protected override void OnDetachedFrom(VisualElement bindable, PlatformView platformView)
{
Console.WriteLine($"==================================== OnDetachedFrom({bindable.GetType().Name}, {platformView.GetType().Name}):\n{Environment.StackTrace}");
base.OnDetachedFrom(bindable, platformView);
}
}