+ /// <summary>
+ /// Store the mapping between this instance of control (View) and native part.
+ /// </summary>
+ /// <param name="view"> The instance of control (View)</param>
+ public static void RegisterView( View view )
+ {
+ // We store a pointer to the RefObject for the control
+ RefObject refObj = view.GetObjectPtr();
+ IntPtr refCptr = (IntPtr) RefObject.getCPtr(refObj);
+
+ //Console.WriteLine ("________Storing ref object cptr in control map Hex: {0:X}", refCptr);
+ if ( !Instance._controlMap.ContainsKey(refCptr) )
+ {
+ Instance._controlMap.Add(refCptr, new WeakReference(view, false));
+ }
+
+ return;
+ }
+
+ /// <summary>
+ /// Remove the this instance of control (View) and native part from the mapping table.
+ /// </summary>
+ /// <param name="view"> The instance of control (View)</param>
+ public static void UnregisterView( View view )
+ {
+ RefObject refObj = view.GetObjectPtr();
+ IntPtr refCptr = (IntPtr) RefObject.getCPtr(refObj);
+
+ if ( Instance._controlMap.ContainsKey(refCptr) )
+ {
+ Instance._controlMap.Remove(refCptr);
+ }
+
+ return;
+ }
+