Exemple #1
0
//		LSCollectionViewHelper objc_getAssociatedObject (UICollectionViewDraggable uICollectionViewDraggable, object lSCollectionViewHelperObjectKey)
//		{
//			throw new NotImplementedException ();
//		}

//		public UICollectionViewDraggable ()
//		{
//		}
        /*unsafe*/ void DraggableCleanup()
        {
            LSCollectionViewHelper helper = (LSCollectionViewHelper)MonoTouch.ObjCRuntime.Runtime.GetNSObject(objc_getAssociatedObject(this.Handle, Marshal.StringToCoTaskMemUni(LSCollectionViewHelperObjectKey)));

            if (helper != null)
            {
                helper.UnbindFromCollectionView(this);
                objc_setAssociatedObject(this.Handle, Marshal.StringToCoTaskMemUni(LSCollectionViewHelperObjectKey), IntPtr.Zero, OBJC_ASSOCIATION.RETAIN_NONATOMIC);
            }
        }
Exemple #2
0
        LSCollectionViewHelper GetHelper()
        {
            LSCollectionViewHelper helper = (LSCollectionViewHelper)MonoTouch.ObjCRuntime.Runtime.GetNSObject(objc_getAssociatedObject(this.Handle, Marshal.StringToCoTaskMemUni(LSCollectionViewHelperObjectKey)));

            if (helper == null)
            {
                helper = new LSCollectionViewHelper(this);
                objc_setAssociatedObject(this.Handle, Marshal.StringToCoTaskMemUni(LSCollectionViewHelperObjectKey), helper.Handle, OBJC_ASSOCIATION.RETAIN_NONATOMIC);
            }

            return(helper);
        }