private void SwigDirectorOnChildAdd(global::System.IntPtr child)
{
- OnChildAdd(new View(child, false));
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+
+ if (view)
+ {
+ OnChildAdd(view);
+ }
}
private void SwigDirectorOnChildRemove(global::System.IntPtr child)
{
- OnChildRemove(new View(child, false));
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+
+ if (view)
+ {
+ OnChildRemove(view);
+ }
}
private void SwigDirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
private float SwigDirectorCalculateChildSize(global::System.IntPtr child, int dimension)
{
- return CalculateChildSize(new View(child, false), (DimensionType)dimension);
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+ if (view)
+ {
+ return CalculateChildSize(view, (DimensionType)dimension);
+ }
+ return 0.0f;
}
private float SwigDirectorGetHeightForWidth(float width)
private void SwigDirectorOnControlChildAdd(global::System.IntPtr child)
{
- OnControlChildAdd(new View(child, false));
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+ if (view)
+ {
+ OnControlChildAdd(view);
+ }
}
private void SwigDirectorOnControlChildRemove(global::System.IntPtr child)
{
- OnControlChildRemove(new View(child, false));
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+ if (view)
+ {
+ OnControlChildRemove(view);
+ }
}
private void SwigDirectorOnStyleChange(global::System.IntPtr styleManager, int change)
{
- OnStyleChange(new StyleManager(styleManager, true), (StyleChangeType)change);
+ StyleManager stManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
+ if (stManager)
+ {
+ OnStyleChange(stManager, (StyleChangeType)change);
+ }
}
private bool SwigDirectorOnAccessibilityActivated()
private global::System.IntPtr SwigDirectorGetNextKeyboardFocusableView(global::System.IntPtr currentFocusedView, int direction, bool loopEnabled)
{
- return View.getCPtr(GetNextFocusableView(new View(currentFocusedView, true), (View.FocusDirection)direction, loopEnabled)).Handle;
+ return View.getCPtr(GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View, (View.FocusDirection)direction, loopEnabled)).Handle;
}
private void SwigDirectorOnKeyboardFocusChangeCommitted(global::System.IntPtr commitedFocusableView)
{
- OnFocusChangeCommitted(new View(commitedFocusableView, true));
+ OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View);
}
private bool SwigDirectorOnKeyboardEnter()