forked from xamarin/Xamarin.Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNativeViewWrapper.cs
31 lines (25 loc) · 1.03 KB
/
NativeViewWrapper.cs
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
using Windows.UI.Xaml;
namespace Xamarin.Forms.Platform.UWP
{
public class NativeViewWrapper : View
{
public NativeViewWrapper(FrameworkElement nativeElement, GetDesiredSizeDelegate getDesiredSizeDelegate = null, ArrangeOverrideDelegate arrangeOverrideDelegate = null,
MeasureOverrideDelegate measureOverrideDelegate = null)
{
GetDesiredSizeDelegate = getDesiredSizeDelegate;
ArrangeOverrideDelegate = arrangeOverrideDelegate;
MeasureOverrideDelegate = measureOverrideDelegate;
NativeElement = nativeElement;
nativeElement.TransferbindablePropertiesToWrapper(this);
}
public ArrangeOverrideDelegate ArrangeOverrideDelegate { get; set; }
public GetDesiredSizeDelegate GetDesiredSizeDelegate { get; }
public MeasureOverrideDelegate MeasureOverrideDelegate { get; set; }
public FrameworkElement NativeElement { get; }
protected override void OnBindingContextChanged()
{
NativeElement.SetBindingContext(BindingContext, nv => nv.GetChildren<FrameworkElement>());
base.OnBindingContextChanged();
}
}
}