Ejemplo n.º 1
0
        /**
         * Sends a message to each object recreated after all objects
         * Have been loaded an initialized
         * https://developer.apple.com/documentation/objectivec/nsobject/1402907-awakefromnib
         */
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            //Prevent highlighting of cell onclick
            this.SelectionStyle = UITableViewCellSelectionStyle.None;
            //Links for more information
            //https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/touch/ios-touch-walkthrough#Gesture_Recognizer_Samples
            //https://github.com/xamarin/recipes/blob/master/Recipes/ios/input/touch/tap-gesture/TapGesture/TapGestureViewController.cs
            //https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/tap
            //Configuration for label
            UITapGestureRecognizer DurationLblTapGestureRecognizer = new UITapGestureRecognizer(TapEventTriggered);

            DurationLblTapGestureRecognizer.NumberOfTapsRequired = 1;
            DurationLblTapGestureRecognizer.CancelsTouchesInView = false;
            DurationLbl.UserInteractionEnabled = true;
            DurationLbl.AddGestureRecognizer(DurationLblTapGestureRecognizer);
            //Configuration for imageview
            UITapGestureRecognizer DurationIvTapGestureRecognizer = new UITapGestureRecognizer(TapEventTriggered);

            DurationIvTapGestureRecognizer.NumberOfTapsRequired = 1;
            DurationIvTapGestureRecognizer.CancelsTouchesInView = false;
            DurationIv.UserInteractionEnabled = true;
            DurationIv.AddGestureRecognizer(DurationIvTapGestureRecognizer);
            //Note: only a single gesture recogniser can be attached to an element
            //https://developer.apple.com/documentation/uikit/
            CellInit();
        }
Ejemplo n.º 2
0
        void ReleaseDesignerOutlets()
        {
            if (DurationLbl != null)
            {
                DurationLbl.Dispose();
                DurationLbl = null;
            }

            if (NameLbl != null)
            {
                NameLbl.Dispose();
                NameLbl = null;
            }

            if (DurationIv != null)
            {
                DurationIv.Dispose();
                DurationIv = null;
            }
        }