Exemple #1
0
        public void getUserDetails()
        {
            var chatConversationResponce = ChatConversationRepository.GetConversationbyContactId(contactViewModel.ContactId);

            if (chatConversationResponce.success)
            {
                chatConversation = chatConversationResponce.chatConversation;
            }
            if (contactViewModel != null)
            {
                ContactName = ContactRepository.GetContactbyUserId(contactViewModel.ContactId).name;
                contactId   = contactViewModel.ContactId;
                Title       = ContactName;

                var titleView = new UILabel(new CGRect(0, 0, 100, 60));
                titleView.Text      = ContactName;
                titleView.TextColor = UIColor.White;
                var ShowUserProfileViewController = new UITapGestureRecognizer(() =>
                {
                    var viewController = (UserProfileViewController)Storyboard.InstantiateViewController("UserProfileViewController");
                    viewController.contactViewModel = contactViewModel;
                    NavigationController.PushViewController(viewController, true);
                });
                titleView.UserInteractionEnabled = true;
                titleView.AddGestureRecognizer(ShowUserProfileViewController);
                NavigationItem.TitleView = titleView;
            }
        }
Exemple #2
0
        private UILabel CreateLabel(LinkString.Part part)
        {
            UILabel label = new UILabel();

            label.Font = this.Font;
            label.HighlightedTextColor = this.TintColor;
            label.Text      = part.Text;
            label.TextColor = this.TextColor;
            label.TranslatesAutoresizingMaskIntoConstraints = false;

            if (part.HasHandler)
            {
                UILongPressGestureRecognizer pressGesture = new UILongPressGestureRecognizer(gesture => this.OnPartPressed(gesture, part, label));
                pressGesture.MinimumPressDuration = 0.001;

                label.AddGestureRecognizer(pressGesture);
                label.UserInteractionEnabled = true;

                this.SetUnderLineStyle(label, NSUnderlineStyle.Single);
            }

            label.SizeToFit();

            return(label);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FontAwesomeXamarin.FABarButtonItem"/> class.
        /// </summary>
        /// <param name="icon">An icon from <see cref="FontAwesome.Xamarin.FontAwesome"/></param>
        /// <param name="title">A title to display under the icon</param>
        /// <param name="fontColor">The UIColor for the icon and title</param>
        /// <param name="handler">The event handler for when the button is pressed</param>
        public FABarButtonItem(string icon, string title, UIColor fontColor, EventHandler handler) : base()
        {
            UIView view = new UIView(new CGRect(2, 0, 56, 32));

            view.AddGestureRecognizer(new UITapGestureRecognizer(() => {
                handler(this, null);
            }));

            _iconButton = new UIButton(new CGRect(14, 0, 32, 21))
            {
                Font = FontAwesome.Font(20),
            };
            _iconButton.SetTitleColor(fontColor, UIControlState.Normal);
            _iconButton.AddGestureRecognizer(new UITapGestureRecognizer(() => {
                handler(this, null);
            }));

            _iconLabel = new UILabel(new CGRect(0, 22, 56, 10))
            {
                TextColor     = fontColor,
                Font          = UIFont.SystemFontOfSize(10f),
                TextAlignment = UITextAlignment.Center
            };
            _iconLabel.AddGestureRecognizer(new UITapGestureRecognizer(() => {
                handler(this, null);
            }));

            this.IconText = title;
            this.Icon     = icon;

            view.Add(_iconButton);
            view.Add(_iconLabel);

            CustomView = view;
        }
        public ClockViewController(BedsideClock.Model.Options options)
        {
            this.options = options;
            textView = new UILabel {
                BackgroundColor = UIColor.Black,
                TextColor = UIColor.Green,
                Text = "12:00",
                TextAlignment = UITextAlignment.Center,
                UserInteractionEnabled = true,
                AdjustsFontSizeToFitWidth = true
            };

            if (options.Font != null)
                textView.Font = UIFont.FromName(options.Font, 200);
            else
                textView.Font = textView.Font.WithSize(200);
            textView.AddGestureRecognizer(new UITapGestureRecognizer(ToggleNavigationBarVisibility));

            Add(textView);

            timer = new Timer(1000);
            timer.AutoReset = true;
            timer.Elapsed += HandleElapsed;
            timer.Enabled = true;
        }
Exemple #5
0
        public void loadOptionView()
        {
            //Adding to contentView
            propertiesLabel.Text = "OPTIONS";
            contentView.AddSubview(ticksLabel);
            contentView.AddSubview(positionbutton);
            contentView.AddSubview(placementLabel);
            contentView.AddSubview(positionbutton1);
            contentView.AddSubview(positionPicker1);
            contentView.AddSubview(positionPicker2);
            contentView.AddSubview(doneButton);
            contentView.AddSubview(showLabel);
            contentView.AddSubview(labelswitch);
            contentView.AddSubview(snapsToLabel);
            contentView.AddSubview(labelswitch1);

            //Adding to SubView
            subView.AddSubview(contentView);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);
            subView.AddSubview(closeButton);
            subView.AddSubview(propertiesLabel);
            subView.BackgroundColor = UIColor.FromRGB(230, 230, 230);
            this.AddSubview(subView);

            //ShowPropertyButton
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle("OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            showPropertyButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            showPropertyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);


            //closeButton
            closeButton.SetTitle("X\t", UIControlState.Normal);
            closeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            closeButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            closeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            closeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            };

            //AddingGesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertiesLabel.UserInteractionEnabled = true;
            propertiesLabel.AddGestureRecognizer(tapgesture);
        }
Exemple #6
0
        private UIView GetDefaultSessionIndicator(UIView container)
        {
            var indicator = new UILabel();

            indicator.BackgroundColor        = new UIColor(red: 1.0f, green: 0.0f, blue: 0.0f, alpha: 0.7f);
            indicator.Text                   = "End Session";
            indicator.UserInteractionEnabled = true;
            indicator.TextAlignment          = UITextAlignment.Center;
            indicator.Font.WithSize(UIFont.SmallSystemFontSize);
            indicator.TextColor          = UIColor.White;
            indicator.Layer.CornerRadius = 10;
            indicator.ClipsToBounds      = true;
            indicator.TranslatesAutoresizingMaskIntoConstraints = false;
            container.AddSubview(indicator);

            indicator.WidthAnchor.ConstraintEqualTo(200f).Active = true;
            indicator.HeightAnchor.ConstraintEqualTo(40f).Active = true;
            indicator.CenterXAnchor.ConstraintEqualTo(container.CenterXAnchor).Active = true;
            indicator.BottomAnchor.ConstraintEqualTo(container.BottomAnchor, constant: -20f).Active = true;

            var tapRecognizer = new UITapGestureRecognizer(() =>
            {
                CobrowseIO.Instance.CurrentSession?.End(null);
            });

            tapRecognizer.NumberOfTapsRequired = 1;
            indicator.AddGestureRecognizer(tapRecognizer);
            return(indicator);
        }
        public MaterialCheckBox()
        {
            Label = new UILabel
            {
                Lines            = 0,
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth,
                TranslatesAutoresizingMaskIntoConstraints = false,
                Font      = UIFontExtensions.RobotoMediumOfSize(NormalFontSize),
                TextColor = NBConfig.PrimaryTextDark,
                UserInteractionEnabled = true
            };

            AddSubview(Label);

            Checkbox = new BEMCheckBox(new CGRect(0, 0, 25, 25))
            {
                BoxType          = BEMBoxType.Square,
                OnAnimationType  = BEMAnimationType.Fill,
                OffAnimationType = BEMAnimationType.Fill,
                OnFillColor      = NBConfig.AccentColor,
                OnTintColor      = NBConfig.AccentColor,
                OnCheckColor     = UIColor.White
            };
            AddSubview(Checkbox);

            var tapGesture = new UITapGestureRecognizer(() => Checkbox.SetOn(!Checkbox.On, true));

            Label.AddGestureRecognizer(tapGesture);
        }
        private UILabel CreateSeatSelectionLayout(string count)
        {
            var seatCountLabel = new UILabel();

            if (count == "2")
            {
                seatCountLabel.BackgroundColor = UIColor.FromRGB(0, 124, 238);
                seatCountLabel.TextColor       = UIColor.White;
            }
            else
            {
                seatCountLabel.BackgroundColor = UIColor.White;
                seatCountLabel.TextColor       = UIColor.Black;
            }

            seatCountLabel.Text = count;

            seatCountLabel.Font                   = UIFont.BoldSystemFontOfSize(12);
            seatCountLabel.TextAlignment          = UITextAlignment.Center;
            seatCountLabel.UserInteractionEnabled = true;
            var tapGesture = new UITapGestureRecognizer(SeatSelected)
            {
                NumberOfTapsRequired = 1
            };

            seatCountLabel.AddGestureRecognizer(tapGesture);
            return(seatCountLabel);
        }
Exemple #9
0
        private void LayoutSkipLabel()
        {
            if (_skipLabel == null)
            {
                _skipLabel = new UILabel();
                AddSubview(_skipLabel);
            }
            _skipLabel.Font          = SkipTextFont != null ? SkipTextFont : UIFont.SystemFontOfSize(SkipTextSize);
            _skipLabel.TextColor     = SkipTextColor;
            _skipLabel.TextAlignment = UITextAlignment.Center;
            _skipLabel.LineBreakMode = UILineBreakMode.WordWrap;
            _skipLabel.Text          = SkipText;
            _skipLabel.Lines         = 3;
            //			_skipLabel.BackgroundColor = UIColor.Red;
            _skipLabel.SizeToFit();
            var height = _skipLabel.Frame.Height + (MaterialShowcase.LABEL_MARGIN * 2);
            var width  = _skipLabel.Frame.Width + (MaterialShowcase.LABEL_MARGIN * 2);

            _skipLabel.Frame = new CGRect(x: 0, y: Frame.Height - height, width: width, height: height);
            if (!string.IsNullOrEmpty(SkipText))
            {
                UserInteractionEnabled            = true;
                _skipLabel.UserInteractionEnabled = true;
                // Add skip tap gesture
                _skipLabel.AddGestureRecognizer(GetTapGestureRecognizer(true));
            }
            else
            {
                _skipLabel.UserInteractionEnabled = false;
                UserInteractionEnabled            = false;
            }
        }
        public void getUserDetails()
        {
            if (contactViewModel != null)
            {
                var titleView = new UILabel(new CGRect(0, 0, 100, 60));
                titleView.Text      = contactViewModel.GroupName;
                titleView.TextColor = UIColor.White;
                var ShowGroupDetailsViewController = new UITapGestureRecognizer(() =>
                {
                    var viewController = (GroupDetailsViewController)Storyboard.InstantiateViewController("GroupDetailsViewController");
                    viewController.contactViewModel = contactViewModel;
                    NavigationController.PushViewController(viewController, true);
                });
                titleView.UserInteractionEnabled = true;
                titleView.AddGestureRecognizer(ShowGroupDetailsViewController);
                NavigationItem.TitleView = titleView;
            }

            //if (contactViewModel.ProfileImageUrl != null && contactViewModel.ProfileImageUrl != "")
            //{

            //    Picasso.With(this)
            //   .Load(ContactObject.ProfileImageUrl)
            //  .Resize(100, 100)
            //  .CenterCrop().Placeholder(Resource.Drawable.default_profile)
            //  .Into(IV_Userlogo);
            //}
            //else
            //{
            //    IV_Userlogo.SetBackgroundResource(Resource.Drawable.default_profile);
            //}
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.View.BackgroundColor = UIColor.White;
            this.Title = "Xamagon Hunt!";
            var anchorSharingServiceClient = new AnchorSharingServiceClient(AccountDetails.AnchorSharingServiceUrl);

            UIButton shareDemoButton = new UIButton(UIButtonType.System)
            {
                Frame           = new CGRect(this.View.Frame.Width / 2 - 40, 150, 75, 44),
                BackgroundColor = UIColor.LightGray.ColorWithAlpha((System.nfloat) 0.6)
            };

            shareDemoButton.SetTitle("Start Here", UIControlState.Normal);
            shareDemoButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            this.View.AddSubview(shareDemoButton);

            UILabel shareDemoLabel = new UILabel()
            {
                Text          = "List of Anchors? Click Me!",
                TextAlignment = UITextAlignment.Center,
                Frame         = new CGRect(10, 200, this.View.Frame.Width - 20, 44),
            };

            UILabel listOfAnchors = new UILabel()
            {
                Text          = "...",
                TextAlignment = UITextAlignment.Natural,
                Frame         = new CGRect(10, 230, this.View.Frame.Width - 20, 300),
                //LineBreakMode = UILineBreakMode.WordWrap,
                Lines = 10
            };

            UITapGestureRecognizer labelTap = new UITapGestureRecognizer(async() => {
                var test           = await anchorSharingServiceClient.RetrieveAllAnchors();
                var listItemString = string.Empty;
                int count          = 0;
                foreach (var item in test)
                {
                    count++;
                    char[] MyChar    = { '[', ' ', ']', '"' };
                    string NewString = item.Trim(MyChar);
                    listItemString  += count.ToString() + ". " + NewString + "\n";
                }

                listOfAnchors.Text = listItemString;
            });

            shareDemoLabel.UserInteractionEnabled = true;
            shareDemoLabel.AddGestureRecognizer(labelTap);

            shareDemoButton.TouchUpInside += (sender, e) =>
            {
                this.NavigationController.PushViewController(new ShareDemoController(), true);
            };
            this.View.AddSubview(shareDemoLabel);
            this.View.AddSubview(listOfAnchors);
        }
Exemple #12
0
        public ToastMessageBar(int x, int y, int seconds, String title, String desc, UIImage icon, int width = 384) : base(new CGRect(x, y, width, 80))
        {
            this.ClipsToBounds      = true;
            this.Layer.CornerRadius = 25;
            this.Alpha                  = (nfloat)0.9;
            this.BackgroundColor        = new UIColor(0, 0, 0, 1);
            this.UserInteractionEnabled = true;

            lblTitle           = new UILabel(new CGRect(95, 8, 250, 20));
            lblTitle.Text      = title;
            lblTitle.Lines     = 1;
            lblTitle.Font      = UIFont.PreferredTitle1.WithSize(24);
            lblTitle.TextColor = UIColor.White;
            lblTitle.UserInteractionEnabled = true;

            lblDescription           = new UILabel(new CGRect(95, 32, 250, 40));
            lblDescription.Text      = desc;
            lblDescription.Lines     = 2;
            lblDescription.Font      = UIFont.PreferredBody.WithSize(14);
            lblDescription.TextColor = UIColor.White;
            lblDescription.UserInteractionEnabled = true;

            ivIcon       = new UIImageView(new CGRect(20, 8, 64, 64));
            ivIcon.Image = icon;
            ivIcon.UserInteractionEnabled = true;

            disolveTimer = new Timer((object state) => { disolveTimer.Dispose(); InvokeOnMainThread(() => this.RemoveFromSuperview());  onDisolve?.Invoke(); }, null, seconds * 1000, 0);

            #region GestureRecognizers

            this.AddGestureRecognizer(new UITapGestureRecognizer(OnBarTap));
            lblTitle.AddGestureRecognizer(new UITapGestureRecognizer(OnBarTap));
            ivIcon.AddGestureRecognizer(new UITapGestureRecognizer(OnBarTap));
            lblDescription.AddGestureRecognizer(new UITapGestureRecognizer(OnBarTap));

            this.AddGestureRecognizer(new UISwipeGestureRecognizer(OnBarSwipe));
            lblTitle.AddGestureRecognizer(new UISwipeGestureRecognizer(OnBarSwipe));
            lblDescription.AddGestureRecognizer(new UISwipeGestureRecognizer(OnBarSwipe));
            ivIcon.AddGestureRecognizer(new UISwipeGestureRecognizer(OnBarSwipe));

            #endregion

            this.Add(lblTitle);
            this.Add(lblDescription);
            this.Add(ivIcon);
        }
Exemple #13
0
        protected void DismissKeyboardOnBackgroundTap()
        {
            var tap = new UITapGestureRecognizer {
                CancelsTouchesInView = false
            };

            //tap.AddTarget(() => View.EndEditing(true));

            tap.AddTarget(() => {
                UIAlertView alert = new UIAlertView()
                {
                    Title = "Do you want save the review ?",
                    //Message = "Coming Soon..."
                };

                alert.AddButton("No");
                alert.AddButton("Yes");
                alert.Clicked += (senderalert, buttonArgs) =>
                {
                    if (buttonArgs.ButtonIndex == 1)
                    {
                        if (CurrentUser.RetreiveUserId() == 0)
                        {
                            UIAlertView alert1 = new UIAlertView()
                            {
                                Title = "This feature is allowed only for VIP Card holders",
                                //Message = "Coming Soon..."
                            };
                            //LoggingClass.LogInfo("Clicked on seacuces", screenid);
                            alert1.AddButton("OK");
                            alert1.AddButton("Know more");
                            alert1.Clicked += (sender, buttonArg) =>
                            {
                                if (buttonArgs.ButtonIndex == 1)
                                {
                                    UIApplication.SharedApplication.OpenUrl(new NSUrl("https://hangoutz.azurewebsites.net/index.html"));
                                }
                            };
                            alert1.Show();
                        }
                        else
                        {
                            NavController.DismissViewController(true, null);
                            SaveReview();
                        }
                    }
                    else if (buttonArgs.ButtonIndex == 0)
                    {
                        NavController.DismissViewController(true, null);
                        BTProgressHUD.Dismiss();
                    }
                };
                alert.Show();
            });
            lblTrans.UserInteractionEnabled = true;
            lblTrans.AddGestureRecognizer(tap);
        }
        public TheaterTile()
        {
            theaterLayout = new TheaterLayout();

            infoImage       = new UIImageView();
            infoImage.Alpha = 0.54f;
            infoImage.UserInteractionEnabled = true;
            var tapGesture = new UITapGestureRecognizer(DisplayInfo)
            {
                NumberOfTapsRequired = 1
            };

            infoImage.AddGestureRecognizer(tapGesture);

            theaterTitle      = new UILabel();
            theaterTitle.Font = UIFont.PreferredCaption1;

            theaterLocation           = new UILabel();
            theaterLocation.Font      = UIFont.PreferredFootnote;
            theaterLocation.TextColor = UIColor.LightGray;

            timing1                        = new UILabel();
            timing1.TextColor              = UIColor.FromRGB(0, 124, 238);
            timing1.Font                   = UIFont.PreferredCaption2;
            timing1.TextAlignment          = UITextAlignment.Center;
            timing1.Layer.BorderColor      = UIColor.FromRGBA(0, 124, 238, 26).CGColor;
            timing1.Layer.BorderWidth      = 0.5f;
            timing1.UserInteractionEnabled = true;
            var timingTapGesture = new UITapGestureRecognizer(TimingTapped)
            {
                NumberOfTapsRequired = 1
            };

            timing1.AddGestureRecognizer(timingTapGesture);

            timing2                        = new UILabel();
            timing2.TextColor              = UIColor.FromRGB(0, 124, 238);
            timing2.Font                   = UIFont.PreferredCaption2;
            timing2.TextAlignment          = UITextAlignment.Center;
            timing2.Layer.BorderColor      = UIColor.FromRGBA(0, 124, 238, 26).CGColor;
            timing2.UserInteractionEnabled = true;
            var timingTapGesture2 = new UITapGestureRecognizer(TimingTapped)
            {
                NumberOfTapsRequired = 1
            };

            timing2.AddGestureRecognizer(timingTapGesture2);
            timing2.Layer.BorderWidth = 0.5f;

            theaterLayout.AddSubview(theaterTitle);
            theaterLayout.AddSubview(theaterLocation);
            theaterLayout.AddSubview(timing1);
            theaterLayout.AddSubview(timing2);
            theaterLayout.AddSubview(infoImage);
            this.AddSubview(theaterLayout);
            this.CanRendererUnload = false;
        }
        public void AddTapGestureRecognizerToDigitLabel(UILabel uiLabel)
        {
            uiLabel.UserInteractionEnabled = true;
            UITapGestureRecognizer lblDigitTap = new UITapGestureRecognizer(() =>
            {
                txtVerificationCode.BecomeFirstResponder();
            });

            uiLabel.AddGestureRecognizer(lblDigitTap);
        }
Exemple #16
0
        private void CreateAttributedString(UILabel control, string html)
        {
            var attr    = new NSAttributedStringDocumentAttributes();
            var nsError = new NSError();

            attr.DocumentType = NSDocumentType.HTML;
            // --------------
            // 02-01-2018 : Fix for default font family => https://github.com/matteobortolazzo/HtmlLabelPlugin/issues/9
            var fontDescriptor = control.Font.FontDescriptor.VisibleName;
            var fontFamily     = fontDescriptor.ToLower().Contains("system") ? "-apple-system,system-ui,BlinkMacSystemFont,Segoe UI" : control.Font.FamilyName;

            html += "<style> body{ font-family: " + fontFamily + ";}</style>";
            // --------------
            var myHtmlData = NSData.FromString(html, NSStringEncoding.Unicode);
            // control.Lines = 0;
            var mutable = new NSMutableAttributedString(new NSAttributedString(myHtmlData, attr, ref nsError));
            var links   = new List <LinkData>();

            control.AttributedText = mutable;

            // make a list of all links:
            mutable.EnumerateAttributes(new NSRange(0, mutable.Length), NSAttributedStringEnumeration.LongestEffectiveRangeNotRequired, (NSDictionary attrs, NSRange range, ref bool stop) =>
            {
                foreach (var a in attrs) // should use attrs.ContainsKey(something) instead
                {
                    if (a.Key.ToString() != "NSLink")
                    {
                        continue;
                    }
                    links.Add(new LinkData(range, a.Value.ToString()));
                    return;
                }
            });

            // Set up a Gesture recognizer:
            if (links.Count <= 0)
            {
                return;
            }
            control.UserInteractionEnabled = true;
            var tapGesture = new UITapGestureRecognizer((tap) =>
            {
                var url = DetectTappedUrl(tap, (UILabel)tap.View, links);
                if (url != null)
                {
                    // open the link:
                    Device.OpenUri(new Uri(url));
                }
            });

            control.AddGestureRecognizer(tapGesture);
        }
Exemple #17
0
        private void prepareSyncStateLabel()
        {
            syncStateLabel.TextColor = UIColor.White;
            syncStateLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            syncStateLabel.Font = syncStateLabel.Font.WithSize(syncLabelFontSize);
            syncStateLabel.CenterXAnchor.ConstraintEqualTo(syncStateView.CenterXAnchor).Active   = true;
            syncStateLabel.BottomAnchor.ConstraintEqualTo(syncStateView.BottomAnchor, -6).Active = true;

            var tapGestureRecognizer = new UITapGestureRecognizer(onStatusLabelTap);

            syncStateLabel.UserInteractionEnabled = true;
            syncStateLabel.AddGestureRecognizer(tapGestureRecognizer);
        }
        public static void HandleLinkTap(this UILabel control, HtmlLabel element)
        {
            void TapHandler(UITapGestureRecognizer tap)
            {
                var detectedUrl = DetectTappedUrl(tap, (UILabel)tap.View);

                RendererHelper.HandleUriClick(element, detectedUrl);
            }

            var tapGesture = new UITapGestureRecognizer(TapHandler);

            control.AddGestureRecognizer(tapGesture);
            control.UserInteractionEnabled = true;
        }
        public NotificationBar(NSCoder coder)
            : base(coder)
        {
            heightConstraint = NSLayoutConstraint.Create(this, Height, Equal, null, NoAttribute, 1, 0);
            TranslatesAutoresizingMaskIntoConstraints = false;
            BackgroundColor = UIColor.Black;

            AddConstraint(heightConstraint);
            label = new UILabel {
                Text          = "You have a new CloudKit notification!",
                TextColor     = UIColor.White,
                TextAlignment = UITextAlignment.Center,
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = true,
                UserInteractionEnabled = true
            };
            AddSubview(label);

            button = new UIButton();
            button.SetTitle("✕", UIControlState.Normal);
            button.AddTarget(Close, UIControlEvent.TouchDown);
            button.TranslatesAutoresizingMaskIntoConstraints = false;
            button.Hidden = true;

            AddSubview(button);

            var rightConstraint = NSLayoutConstraint.Create(this, RightMargin, Equal, button, Right, 1, 0);

            AddConstraint(rightConstraint);

            var centerConstraint = NSLayoutConstraint.Create(this, CenterY, Equal, button, CenterY, 1, 0);

            AddConstraint(centerConstraint);

            var leftConstraint = NSLayoutConstraint.Create(this, LeftMargin, Equal, label, Left, 1, 0);

            AddConstraint(leftConstraint);

            var rightLabelConstraint = NSLayoutConstraint.Create(button, Left, Equal, label, Right, 1, 8);

            AddConstraint(rightLabelConstraint);

            var centerLabelConstraint = NSLayoutConstraint.Create(this, CenterY, Equal, label, CenterY, 1, 0);

            AddConstraint(centerLabelConstraint);

            var tapGestureRecognizer = new UITapGestureRecognizer(ShowNotification);

            label.AddGestureRecognizer(tapGestureRecognizer);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <MyLabel> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    var uiLabel = new UILabel
                    {
                        UserInteractionEnabled = true,
                        LineBreakMode          = UILineBreakMode.WordWrap,
                        Lines = 0,
                        Text  = "عندما يريد العالم أن ‪يتكلّم ‬ ، فهو يتحدّث بلغة يونيكود. تسجّل الآن لحضور المؤتمر الدولي العاشر ليونيكود (Unicode Conference)، الذي سيعقد في 10-12 آذار 1997 بمدينة مَايِنْتْس، ألمانيا. و سيجمع المؤتمر بين خبراء من كافة قطاعات الصناعة على الشبكة العالمية انترنيت ويونيكود، حيث ستتم، على الصعيدين الدولي والمحلي على حد سواء مناقشة سبل استخدام يونكود في النظم القائمة وفيما يخص التطبيقات الحاسوبية، الخطوط، تصميم النصوص والحوسبة متعددة اللغات...TapMe"
                    };

                    var uiTapGestureRecognizer = new UITapGestureRecognizer();
                    uiTapGestureRecognizer.AddTarget(() =>
                    {
                        var label      = uiLabel;
                        var recognizer = uiTapGestureRecognizer;
                        var range      = new NSRange(uiLabel.Text.Length - "TapMe".Length, "TapMe".Length);

                        using (var ts = new NSTextStorage())
                        {
                            var lm = new NSLayoutManager();
                            var tc = new NSTextContainer(new CGSize(label.Frame.Width, double.MaxValue));

                            lm.AddTextContainer(tc);
                            ts.Append(label.AttributedText);
                            ts.AddLayoutManager(lm);

                            tc.LineFragmentPadding  = (float)0.0;
                            tc.LineBreakMode        = label.LineBreakMode;
                            tc.MaximumNumberOfLines = (uint)label.Lines;
                            tc.Size = label.Bounds.Size;

                            var index         = lm.GetCharacterIndex(recognizer.LocationOfTouch(0, label), tc);
                            var isWithinRange = (nint)index >= range.Location && (nint)index < range.Location + range.Length;

                            App.Current.MainPage.DisplayAlert("Alert", "Character count: " + label.Text.Length + "\nRange location: " + range.Location + "\nRange length:" + range.Length + "\nCharacter index: " + index + "\nIs within range: " + isWithinRange, "Dismiss");
                        }
                    });
                    uiLabel.AddGestureRecognizer(uiTapGestureRecognizer);

                    SetNativeControl(uiLabel);
                }
            }
        }
Exemple #21
0
        void AddMainView()
        {
            if (childGrid == null)
            {
                childGrid = new UIView();
            }
            mainGrid = new UIView();
            mainGrid.BackgroundColor = UIColor.FromRGB(243, 239, 233);
            mainGrid.AddSubview(childGrid);
            maps = new SFMap();
            ImageryLayer layer = new ImageryLayer();

            maps.Layers.Add(layer);

            mainGrid.AddSubview(maps);
            label1               = new UILabel();
            label1.TextColor     = UIColor.Black;
            label1.LayoutMargins = new UIEdgeInsets(2, 2, 3, 2);
            label1.Font          = UIFont.FromName("Helvetica", 12);
            var text           = new NSString("©");
            var stringAtribute = new NSDictionary(UIStringAttributeKey.Font, label1.Font,
                                                  UIStringAttributeKey.ForegroundColor, UIColor.Black);
            UIStringAttributes strAtr = new UIStringAttributes(stringAtribute);

            label1.Text            = text;
            label1Size             = text.GetSizeUsingAttributes(strAtr);
            label1.BackgroundColor = UIColor.White;
            mainGrid.AddSubview(label1);
            label2               = new UILabel();
            label2.TextColor     = UIColor.FromRGB(0, 212, 255);
            label2.LayoutMargins = new UIEdgeInsets(1, 2, 3, 2);
            label2.Font          = UIFont.FromName("Helvetica", 12);
            var text1           = new NSString("OpenStreetMap contributors.");
            var stringAtribute1 = new NSDictionary(UIStringAttributeKey.Font, label2.Font,
                                                   UIStringAttributeKey.ForegroundColor, UIColor.FromRGB(0, 212, 255));
            UIStringAttributes strAtr1 = new UIStringAttributes(stringAtribute);

            label2.Text                   = text1;
            label2Size                    = text1.GetSizeUsingAttributes(strAtr1);
            label2.BackgroundColor        = UIColor.White;
            label2.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer();

            tapGesture.ShouldReceiveTouch += TapGesture_ShouldReceiveTouch;
            label2.AddGestureRecognizer(tapGesture);
            mainGrid.AddSubview(label2);
        }
        private void CreateAttributedString(UILabel control, string html)
        {
            var attr    = new NSAttributedStringDocumentAttributes();
            var nsError = new NSError();

            attr.DocumentType = NSDocumentType.HTML;

            var myHtmlData = NSData.FromString(html, NSStringEncoding.Unicode);
            // control.Lines = 0;
            var mutable = new NSMutableAttributedString(new NSAttributedString(myHtmlData, attr, ref nsError));
            var links   = new List <LinkData>();

            control.AttributedText = mutable;

            // make a list of all links:
            mutable.EnumerateAttributes(new NSRange(0, mutable.Length), NSAttributedStringEnumeration.LongestEffectiveRangeNotRequired, (NSDictionary attrs, NSRange range, ref bool stop) =>
            {
                foreach (var a in attrs) // should use attrs.ContainsKey(something) instead
                {
                    if (a.Key.ToString() != "NSLink")
                    {
                        continue;
                    }
                    links.Add(new LinkData(range, a.Value.ToString()));
                    return;
                }
            });

            // Set up a Gesture recognizer:
            if (links.Count <= 0)
            {
                return;
            }
            control.UserInteractionEnabled = true;
            var tapGesture = new UITapGestureRecognizer((tap) =>
            {
                var url = DetectTappedUrl(tap, (UILabel)tap.View, links);
                if (url != null)
                {
                    // open the link:
                    Device.OpenUri(new Uri(url));
                }
            });

            control.AddGestureRecognizer(tapGesture);
        }
		public NotificationBar (NSCoder coder)
			: base (coder)
		{
			heightConstraint = NSLayoutConstraint.Create (this, Height, Equal, null, NoAttribute, 1, 0);
			TranslatesAutoresizingMaskIntoConstraints = false;
			BackgroundColor = UIColor.Black;

			AddConstraint (heightConstraint);
			label = new UILabel {
				Text = "You have a new CloudKit notification!",
				TextColor = UIColor.White,
				TextAlignment = UITextAlignment.Center,
				TranslatesAutoresizingMaskIntoConstraints = false,
				Hidden = true,
				UserInteractionEnabled = true
			};
			AddSubview (label);

			button = new UIButton ();
			button.SetTitle ("✕", UIControlState.Normal);
			button.AddTarget (Close, UIControlEvent.TouchDown);
			button.TranslatesAutoresizingMaskIntoConstraints = false;
			button.Hidden = true;

			AddSubview (button);

			var rightConstraint = NSLayoutConstraint.Create (this, RightMargin, Equal, button, Right, 1, 0);
			AddConstraint (rightConstraint);

			var centerConstraint = NSLayoutConstraint.Create (this, CenterY, Equal, button, CenterY, 1, 0);
			AddConstraint (centerConstraint);

			var leftConstraint = NSLayoutConstraint.Create (this, LeftMargin, Equal, label, Left, 1, 0);
			AddConstraint (leftConstraint);

			var rightLabelConstraint = NSLayoutConstraint.Create (button, Left, Equal, label, Right, 1, 8);
			AddConstraint (rightLabelConstraint);

			var centerLabelConstraint = NSLayoutConstraint.Create (this, CenterY, Equal, label, CenterY, 1, 0);
			AddConstraint (centerLabelConstraint);

			var tapGestureRecognizer = new UITapGestureRecognizer (ShowNotification);
			label.AddGestureRecognizer (tapGestureRecognizer);
		}
        public void getUserDetails()
        {
            //var chatConversationResponse = ChatConversationRepository.GetConversationbyContactId(contactViewModel.ContactId);
            //if(chatConversationResponse.success)
            //{

            //}

            if (contactViewModel != null)
            {
                ContactName = ContactRepository.GetContactbyUserId(contactViewModel.ContactId).name;
                contactId   = contactViewModel.ContactId;
                Title       = ContactName;


                var titleView = new UILabel(new CGRect(0, 0, 100, 60));
                titleView.Text      = ContactName;
                titleView.TextColor = UIColor.White;
                var ShowUserProfileViewController = new UITapGestureRecognizer(() =>
                {
                    var viewController = (UserProfileViewController)Storyboard.InstantiateViewController("UserProfileViewController");
                    viewController.contactViewModel = contactViewModel;
                    NavigationController.PushViewController(viewController, true);
                });
                titleView.UserInteractionEnabled = true;
                titleView.AddGestureRecognizer(ShowUserProfileViewController);
                NavigationItem.TitleView = titleView;
            }

            //if (contactViewModel.ProfileImageUrl != null && contactViewModel.ProfileImageUrl != "")
            //{

            //    Picasso.With(this)
            //   .Load(ContactObject.ProfileImageUrl)
            //  .Resize(100, 100)
            //  .CenterCrop().Placeholder(Resource.Drawable.default_profile)
            //  .Into(IV_Userlogo);
            //}
            //else
            //{
            //    IV_Userlogo.SetBackgroundResource(Resource.Drawable.default_profile);
            //}
        }
Exemple #25
0
        protected UILabel CreateLabel(string text = null, UITapGestureRecognizer tapGestureRecognizer = null)
        {
            var label = new UILabel {
                Text            = text,
                TextAlignment   = UITextAlignment.Left,
                Font            = UIFont.FromName("Helvetica-Light", AppDelegate.Font10_5Pt),
                TextColor       = UIColor.DarkGray,
                BackgroundColor = UIColor.FromWhiteAlpha(0f, 0f)
            };

            if (tapGestureRecognizer != null)
            {
                label.UserInteractionEnabled = true;
                label.AddGestureRecognizer(tapGestureRecognizer);
            }

            this.ApplyDebugUIAttributes(label);
            return(label);
        }
Exemple #26
0
        public DashboardViewController() : base()
        {
            Title = "Главная";
            View.BackgroundColor = UIColor.White;

            todayLabel = new UILabel();
            View.Add(todayLabel);
            todayLabel.BackgroundColor        = UIColor.Red;
            todayLabel.Text                   = "Сегодня";
            todayLabel.UserInteractionEnabled = true;
            todayLabel.AddGestureRecognizer(new UITapGestureRecognizer(TodayView_TouchUpInside));

            tomorrowLabel = new UILabel();
            View.Add(tomorrowLabel);
            tomorrowLabel.BackgroundColor        = UIColor.Green;
            tomorrowLabel.Text                   = "Завтра";
            tomorrowLabel.UserInteractionEnabled = true;
            tomorrowLabel.AddGestureRecognizer(new UITapGestureRecognizer(TomorrowView_TouchUpInside));

            thisWeekLabel = new UILabel();
            View.Add(thisWeekLabel);
            thisWeekLabel.BackgroundColor        = UIColor.Gray;
            thisWeekLabel.Text                   = "На этой неделе";
            thisWeekLabel.UserInteractionEnabled = true;
            thisWeekLabel.AddGestureRecognizer(new UITapGestureRecognizer(ThisWeekView_TouchUpInside));

            nextWeekLabel = new UILabel();
            View.Add(nextWeekLabel);
            nextWeekLabel.BackgroundColor        = UIColor.Yellow;
            nextWeekLabel.Text                   = "На следующей неделе";
            nextWeekLabel.UserInteractionEnabled = true;
            nextWeekLabel.AddGestureRecognizer(new UITapGestureRecognizer(NextWeekView_TouchUpInside));

            plusButton = new UIButton();
            View.Add(plusButton);
            plusButton.SetTitle("+", UIControlState.Normal);
            plusButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            plusButton.BackgroundColor    = View.TintColor;
            plusButton.Layer.CornerRadius = 5;
            plusButton.Font           = UIFont.SystemFontOfSize(30);
            plusButton.TouchUpInside += PlusButton_TouchUpInside;
        }
Exemple #27
0
        public NativeCustomCell(Cell formsCell) : base(UIKit.UITableViewCellStyle.Default, formsCell.GetType().FullName)
        {
            Cell = formsCell;

            //UILabelの生成と配置
            _titleLabel = new UILabel();

            ContentView.AddSubview(_titleLabel);
            _titleLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            _titleLabel.CenterXAnchor.ConstraintEqualTo(ContentView.CenterXAnchor).Active = true;
            _titleLabel.CenterYAnchor.ConstraintEqualTo(ContentView.CenterYAnchor).Active = true;

            var tap = new UITapGestureRecognizer(_ =>
            {
                CustomCell.Command?.Execute(_titleLabel.Text);
            });

            _titleLabel.AddGestureRecognizer(tap);
            _titleLabel.UserInteractionEnabled = true;
        }
Exemple #28
0
        public void AddSegment(string title)
        {
            var label = new UILabel(); //UIButton.FromType(UIButtonType.System);

            _titleSegments.Add(title);
            label.Text = title;
            label.Tag  = _titleSegments.Count - 1;
            UITapGestureRecognizer tapGisture = new UITapGestureRecognizer(() =>
            {
                CurrentSegment = (int)label.Tag;
                ChangeSegment?.Invoke(this, CurrentSegment);
                Draw(Frame);
            });

            label.UserInteractionEnabled = true;
            label.AddGestureRecognizer(tapGisture);
            var container = new UIView();

            container.Add(label);
            _segments.Add(container);
            Add(container);
        }
Exemple #29
0
        private void  StartPulse()
        {
            _pulseLabel = new UILabel(new CGRect(0, 0, this.Control.Frame.Width, this.Control.Frame.Height))
            {
                Text          = this.Control.Title(UIControlState.Normal),
                TextColor     = Color.FromHex("#ff0080").ToUIColor(),
                Font          = this.Control.Font,
                Alpha         = 0,
                TextAlignment = UITextAlignment.Center,
            };
            _pulseLabel.UserInteractionEnabled = true;

            // adding a touch event to UILabel since it covers UIButton touch area
            UITapGestureRecognizer tapGestureRecognizer = new UITapGestureRecognizer(
                () =>
            {
                // redirect label touch event to Button touch event
                this.Control.SendActionForControlEvents(UIControlEvent.TouchUpInside);
            });

            _pulseLabel.AddGestureRecognizer(tapGestureRecognizer);

            Add(_pulseLabel);

            UIView.Animate(1, 0,
                           UIViewAnimationOptions.Autoreverse |
                           UIViewAnimationOptions.Repeat |
                           UIViewAnimationOptions.AllowUserInteraction,
                           () =>
            {
                _pulseLabel.Alpha = 1;
            },
                           () =>
            {
                return;
            });
        }
		public void ViewQualityMetrics(List<iProPQRSPortableLib.Type> Types,List<iProPQRSPortableLib.Option> DropdownOption, string HeaderTitle)
		{
			float hUVB=200;
			UIView finalView=new UIView();
			UIView uvBlock = new UIView ();
			UIImageView titleimg = new UIImageView (new CoreGraphics.CGRect (0, 0, 992, 40));
			titleimg.Image=UIImage.FromFile(@"headerBarTall.png");
			UILabel lbltitle = new UILabel (new CoreGraphics.CGRect (8, 8, 140, 21));
			lbltitle.Text = HeaderTitle;
			uvBlock.Add (titleimg);
			uvBlock.Add (lbltitle);
			float yuvc = 50;

			UIView uvcontrol;
			//mainrootview.RootData.Sort((x,y)=> x.ItemID.CompareTo(y.ItemID));
			Types.Sort((xx,yy)=> xx.ProcAttribTypeID.CompareTo(yy.ProcAttribTypeID));
			for (int i = 0; i < Types.Count; i++) {

				List<iProPQRSPortableLib.Option> masterMainList = new List<iProPQRSPortableLib.Option>();
				List<iProPQRSPortableLib.Option> masterSubCatList = new List<iProPQRSPortableLib.Option>();


				if (!string.IsNullOrEmpty (Types [i].Label)) {
					uvcontrol = new UIView (new CoreGraphics.CGRect (0, yuvc, 992, 45));				        
					UILabel lblname = new UILabel (new CoreGraphics.CGRect (20, 8, 500, 21));
					lblname.Text = Types [i].Label;
					string selectedtext = string.Empty;
					string selectedid = string.Empty;
					string selectedsubitemtext = string.Empty;
					string Attriblabel = string.Empty;
					int AttribTypeID=0;

					if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) {						
						var selecteditem = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.Where (u => u.ProcAttribTypeID == Types [i].ProcAttribTypeID ).SingleOrDefault ();
						if (selecteditem != null) {
							AttribTypeID = selecteditem.ProcAttribTypeID;
							Attriblabel = selecteditem.Value;
							string[] arrytxt;
							//var ditem = DropdownOption.Where (u => u.Value == selecteditem.Value && u.ProcAttribTypeID == selecteditem.ProcAttribTypeID).ToList ();
							arrytxt = DropdownOption.Where (u => u.Value == selecteditem.Value && u.ProcAttribTypeID == selecteditem.ProcAttribTypeID).Select (s => s.Description).ToArray ();
							if (arrytxt != null && arrytxt.Length > 0) {
								selectedtext = arrytxt [0];

							}
						}

					}
					int mlpopid = 0;
					int TypeItemID;
					string TypeValue;
					if (Types [i].ProcAttribTypeID == 605) {
						masterMainList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 686);
						masterSubCatList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 605);
						mlpopid = 686;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[1].ProcAttribTypeID;
							TypeValue=masterMainList[1].Value; 
						}


					} else if (Types [i].ProcAttribTypeID == 607) {
						mlpopid = 685;
						masterMainList = ASA8MasterList;
						masterSubCatList = ASA8SubMasterList;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[1].ProcAttribTypeID;
							TypeValue=masterMainList[1].Value; 
						}

					}
					else if (Types [i].ProcAttribTypeID == 656) {
						mlpopid = 687;
						masterMainList = ASA9MasterList;
						masterSubCatList = ASA9SubMasterList;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[1].ProcAttribTypeID;
							TypeValue=masterMainList[1].Value; 
						}

					}
					else {
						mlpopid = Types [i].ProcAttribTypeID ;
						masterMainList = DropdownOption.FindAll (u => u.ProcAttribTypeID == Types [i].ProcAttribTypeID);
					}
					if (Types [i].ProcAttribTypeID == 605 || Types [i].ProcAttribTypeID == 607 || Types [i].ProcAttribTypeID == 656) {
						//&& Attriblabel=="0582F"
						string str=mlpopid.ToString();
						var	selectedMainListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
						if (selectedMainListIDs.Count > 0)
						{   string[] arrytxt;
							arrytxt = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Where (u => u.Value == selectedMainListIDs[0].Value && u.ProcAttribTypeID == selectedMainListIDs[0].ProcAttribTypeID).Select (s => s.Description).ToArray ();
							if(arrytxt.Length > 0)
							  selectedtext = arrytxt[0];
						}
						var selectedSubCatListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll(u => (masterSubCatList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList();
						if (selectedSubCatListIDs.Count > 0) {
							selectedsubitemtext = selectedsubitemtext + "(";
							foreach (var SIT in selectedSubCatListIDs) {
								string[] arrytxt;
								arrytxt = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Where (u => u.Value == SIT.Value && u.ProcAttribTypeID == SIT.ProcAttribTypeID).Select (s => s.Description).ToArray ();
								if(arrytxt.Length > 0)
								  selectedsubitemtext = selectedsubitemtext + arrytxt [0] + ",";
							}
							selectedsubitemtext=selectedsubitemtext.TrimEnd (',') + " )";
							//0582F  "0582F"
							if (selectedMainListIDs.Count > 0 && selectedMainListIDs[0].Value == TypeValue)
							    selectedtext = selectedtext + selectedsubitemtext;
						}
					}

				
					//if (masterMainList.Count > 0)
					//	mlpopid = Types [i].ProcAttribTypeID;//masterMainList [0].ProcAttribTypeID;
					//int AttribTypeID = Types [i].ProcAttribTypeID;
					UILabel lblDesc = new UILabel (new CoreGraphics.CGRect (500, 8, 480, 35));
					if (AttribTypeID == 608) {
						if (selectedtext.Contains ("NO Serious adverse event"))
							lblDesc.Text = selectedtext;
						else {
							string finaltext = "( ";
							foreach (var sitem in selectednonPqrsTypeAS10OptionsIds) {
								//nonPqrsTypeAS10Options
								var itemtype = nonPqrsTypeAS10Options.Where (u => u.ProcAttribTypeID == sitem).ToList ();
								if (itemtype.Count > 0)
									finaltext = finaltext + itemtype [0].Label + ",";
							}
							lblDesc.Text = selectedtext + finaltext.TrimEnd (',') + " )";
						}
					}
					else
						lblDesc.Text = selectedtext;
					
					lblDesc.Layer.BorderColor = UIColor.Gray.CGColor;
					lblDesc.Layer.BorderWidth = (nfloat)0.5;
					lblDesc.Layer.CornerRadius = (nfloat)8.0; 
					UILabel lblhidenmaincatval = new UILabel ();
					lblhidenmaincatval.Hidden = true;
					lblhidenmaincatval.Text = Attriblabel;
					lblhidenmaincatval.Tag = AttribTypeID;

					UILabel lblhidensubcatval = new UILabel ();
					lblhidensubcatval.Hidden = true;
					UITapGestureRecognizer lblDescTap = new UITapGestureRecognizer( async()  => {
						List<Tuple<string, string>>  selectedrootitem=new List<Tuple<string, string>>();
						if(lblhidenmaincatval.Tag != 0)
							selectedrootitem.Add(new Tuple<string,string>(lblhidenmaincatval.Tag.ToString(),lblhidenmaincatval.Text));//,);
						//string name=Types [i].Label;
					
						if(mlpopid== 608)
						{

							if(masterMainList.Count>0)
								BindmultilevelPopupover(masterMainList,selectedrootitem,selectednonPqrsTypeAS10OptionsIds,lblDesc,(int)lblDesc.Frame.Y,lblhidenmaincatval,true);
						}
						else if(mlpopid== 686 || mlpopid== 685 || mlpopid== 687)
						{ //605=686
							QualityMetricsASA qmasafrm=new QualityMetricsASA(lblDesc);
							qmasafrm.masterMainList=masterMainList;
							qmasafrm.masterSubCatList=masterSubCatList;
							if(procedureDetails != null && procedureDetails.ID != 0)
								qmasafrm.ProcID=procedureDetails.ID ;
							
							qmasafrm.PresentFromPopover(lblDesc, (float)lblDesc.Frame.X, (float)lblDesc.Frame.Y);

							//if(masterMainList.Count>0)
							//	BindmultilevelPopupover(masterMainList,masterSubCatList,lblDesc,(int)lblDesc.Frame.Y,lblhidenmaincatval,lblhidensubcatval,false,TypeItemID,TypeValue);
						}else if(mlpopid == 606){
							QualityMetricsForm qmFrm = new QualityMetricsForm();
							if(procedureDetails != null && procedureDetails.ID != 0)
								qmFrm.ProcID=procedureDetails.ID ;
							qmFrm.PresentFromPopover(lblDesc, (float)lblDesc.Frame.X, (float)lblDesc.Frame.Y);
						}else{
							if(masterMainList.Count>0)
								BindPopupover(masterMainList,selectedrootitem,lblDesc,(int)lblDesc.Frame.Y,lblhidenmaincatval);
						}
						int ProcID=0;
						if(procedureDetails != null && procedureDetails.ID != 0)
							ProcID = procedureDetails.ID;
						iProPQRSPortableLib.Consts.SelectedProcAttribtslist  = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID);
					});
					lblDesc.UserInteractionEnabled = true;
					lblDesc.AddGestureRecognizer(lblDescTap);


									//UIButton btncontrol = new UIButton (new CoreGraphics.CGRect (550, 8, 319, 30));
									//if(!string.IsNullOrEmpty(selectedtext))
									//	btncontrol.SetTitle (selectedtext, UIControlState.Normal);
									//btncontrol.SetBackgroundImage (UIImage.FromFile (@"textBoxDropDown.png"), UIControlState.Normal);
									//btncontrol.SetTitleColor (UIColor.Black, UIControlState.Normal);

									//btncontrol.TouchUpInside += async (object sender, EventArgs e) => {
									//	List<string>  selectedi=new List<string>{"selected"};
										//string name=Types [i].Label;
									//	if(AttribTypeID== 608)
										//{
											//if(Dropdownlist.Count>0)
												//BindmultilevelPopupover(Dropdownlist,selectedi,btncontrol,(int)btncontrol.Frame.Y,"name");
										//}
										//else
										//{
										//if(Dropdownlist.Count>0)
										//	BindPopupover(Dropdownlist,selectedi,btncontrol,(int)btncontrol.Frame.Y,"name");
										//}
									//};
									//btncontrol.SetTitle (" btn Name " + i, UIControlState.Normal);


					uvcontrol.Add (lblname);
					uvcontrol.Add (lblDesc);	
					uvcontrol.Add (lblhidenmaincatval);
					uvcontrol.Add (lblhidensubcatval);
					yuvc = yuvc + 45;
					uvBlock.Add (uvcontrol);
					uvcontrol = null;
				}
			}
			uvBlock.Frame = new CoreGraphics.CGRect (0, 0, 992, yuvc + 45);
			uvBlock.Layer.BorderColor = UIColor.Gray.CGColor;
			uvBlock.Layer.BorderWidth = 1;
			//new CoreGraphics.CGRect(xUV,0,992,hUV
			hUV = yuvc + 45;
			finalView.Frame = new CoreGraphics.CGRect (0,yUV,992, hUV);
			finalView.BackgroundColor = UIColor.White;
			yUV = yUV+hUV+5;
			finalView.Add (uvBlock);
			svQualityMetrics.Add(finalView);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			this.View.BackgroundColor 	= UIColor.White;
			CGRect parentBounds 		= this.View.Bounds;
			float yPos					= 80f;

			UILabel content 			= new UILabel(RectangleF.Empty);
			content.Text 				= "Essential Studio for iOS is a collection of user interface and file format manipulation components, that can be used to build line-of-business mobile applications.";
			content.Lines 				= 0;
			content.LineBreakMode 		= UILineBreakMode.WordWrap;
			content.Font 				= UIFont.FromName("Helvetica neue", 14f);
			content.ClipsToBounds 		= true;
			content.BackgroundColor 	= UIColor.Clear;
			content.TextColor			= UIColor.FromRGB (137,137,137);
			content.TextAlignment 		= UITextAlignment.Left;
			CGRect contentFrame 		= new CGRect();
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
				contentFrame = new CGRect (23, yPos, parentBounds.Size.Width - 46, 50);
				yPos += 60;
			} 
			else {
				contentFrame = new CGRect (23, yPos, parentBounds.Size.Width - 46, 80);
				yPos += 90;
			}

			content.Frame 				= contentFrame;
			this.View.AddSubview (content);

			UILabel version 			= new UILabel(RectangleF.Empty);
			version.Text 				= "Version 13.3.0.7";
			version.Lines		 		= 1;
			version.Font 				= UIFont.FromName("Helvetica neue", 14f);
			version.ClipsToBounds 		= true;
			version.BackgroundColor 	= UIColor.Clear;
			version.TextColor 			= UIColor.FromRGB (137,137,137);
			version.TextAlignment 		= UITextAlignment.Left;
			CGSize versionSize 			= this.measureLabel (version);
			version.Frame 				= new CGRect (23, yPos, versionSize.Width, versionSize.Height);
			yPos 						+= (float)versionSize.Height + 30;

			this.View.AddSubview (version);

			UILabel contact 			= new UILabel(RectangleF.Empty);
			contact.Text 				= "Contact Us";
			contact.Lines 				= 1;
			contact.Font 				= UIFont.FromName("Helvetica neue", 17f);
			contact.ClipsToBounds 		= true;
			contact.BackgroundColor 	= UIColor.Clear;
			contact.TextColor 			= UIColor.Gray;
			contact.TextAlignment 		= UITextAlignment.Left;
			CGSize contactSize 			= this.measureLabel (contact);
			contact.Frame 				= new CGRect (23, yPos, contactSize.Width, contactSize.Height);
			yPos 						+= (float)contactSize.Height + 20;

			this.View.AddSubview (contact);

			UILabel web 				= new UILabel (RectangleF.Empty);
			web.AttributedText 			= new NSAttributedString (
											"http://www.syncfusion.com", 
											underlineStyle: NSUnderlineStyle.Single);
			web.Lines 					= 1;
			web.Font 					= UIFont.FromName("Helvetica neue", 14f);
			web.ClipsToBounds 			= false;
			web.BackgroundColor 		= UIColor.Clear;
			web.TextColor 				= UIColor.FromRGB (137,137,137);
			web.TextAlignment 			= UITextAlignment.Left;
			CGSize webSize 				= this.measureLabel (web);
			web.Frame 					= new CGRect (23, yPos, webSize.Width+20, webSize.Height);
			web.UserInteractionEnabled 	= true;
			yPos 						+= (float)webSize.Height+15;
			var tap 					= new UITapGestureRecognizer();
			tap.AddTarget(() 			=> UIApplication.SharedApplication.OpenUrl(new NSUrl(web.Text)));
			tap.NumberOfTapsRequired 	= 1;
			tap.DelaysTouchesBegan 		= true;
			web.AddGestureRecognizer(tap);

			View.AddSubview (web);

			UILabel support 				= new UILabel(RectangleF.Empty);
			support.Text 					= "*****@*****.**";
			support.AttributedText 			= new NSAttributedString (
												"*****@*****.**", 
												underlineStyle: NSUnderlineStyle.Single);
			support.Lines 					= 1;
			support.Font 					= UIFont.FromName("Helvetica neue", 14f);
			support.ClipsToBounds 			= true;
			support.BackgroundColor 		= UIColor.Clear;
			support.TextColor 				= UIColor.FromRGB (137,137,137);
			support.TextAlignment 			= UITextAlignment.Left;
			CGSize supportSize 				= this.measureLabel (support);
			support.Frame 					= new CGRect (23, yPos, supportSize.Width, supportSize.Height);
			support.UserInteractionEnabled 	= true;
			yPos 							+= (float)supportSize.Height+15;
			var tapSupport		 			= new UITapGestureRecognizer();
			tapSupport.AddTarget(() 		=> UIApplication.SharedApplication.OpenUrl(new NSUrl("mailto:[email protected]")));
			tapSupport.NumberOfTapsRequired = 1;
			tapSupport.DelaysTouchesBegan 	= true;
			support.AddGestureRecognizer(tapSupport);

			View.AddSubview (support);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			View.BackgroundColor = UIColor.White;

			TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;
			part.PartName.ToLower ();

			var scrollView = new UIScrollView {
				Frame = new CGRect (0, 0, 320, View.Frame.Height * 1.5)
			} ;

			var partNameLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 25f),
				Frame = new CGRect (20, 5, View.Bounds.Width, 30),
				Text = textInfo.ToTitleCase (part.PartName.ToLower ())
			} ;

			var partMakeLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 23f),
				Frame = new CGRect (20, 35, View.Bounds.Width, 25),
				Text = partString
			};

			var priceLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 24f),
				Frame = new CGRect (View.Bounds.Width - 80, 17.5, 70, 30),
				Text = string.Format ("${0}", part.Price),
				TextAlignment = UITextAlignment.Right
			} ;

			var williesGuarentee = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 15f),
				Frame = new CGRect (0, 65, View.Bounds.Width, 20),
				Text = "Willie's Guarentee",
				TextAlignment = UITextAlignment.Center
			} ;

			var guarenteeOne = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 85, View.Bounds.Width - 40, 50),
				Lines = 10,
				Text = "Why go anywhere else? With over 10 million satisified customers in more than 28 years, Willie’s is your best bet for the quality part you are looking for."
			} ;

			var guarenteeTwo = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 140, View.Bounds.Width - 40, 50),
				Lines = 5,
				Text = "Willie’s ships parts daily to many satisified customers. We can ship international, next day air, two day air, three day select, and to post office boxes."
			} ;

			var guarenteeThree = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 205, View.Bounds.Width - 40, 50),
				Lines = 5,
				Text = "We give full refunds or exchange on parts arriving defective and will accept returns on incorrect parts. We do have a restock fee of only 20% if you misorder a part."
			} ;

			var contactButton = new ContactUsButton {
				Frame = new CGRect (40, 260, View.Bounds.Width - 80, 40)
			} ;
			contactButton.SetTitle ("Contact Us", UIControlState.Normal);
			contactButton.SetTitleColor (UIColor.White, UIControlState.Normal);

			contactButton.TouchUpInside += CancelButtonTapped;

			var payButton = new SearchButton {
				Frame = new CGRect (40, 310, View.Bounds.Width - 80, 40)
			} ;
			payButton.SetTitle ("Buy Part", UIControlState.Normal);
			payButton.SetTitleColor (UIColor.White, UIControlState.Normal);
			payButton.TouchUpInside += PaymentButtonTapped;

			var payText = new UILabel {
				Frame = new CGRect (40, 350, View.Bounds.Width - 80, 50),
				Text = "By purchasing part(s) from Willie's Cycles, you agree to the Terms of Service (tap to view).",
				Font = UIFont.FromName ("SegoeUI-Light", 12f),
				Lines = 5,
				TextAlignment = UITextAlignment.Center,
				UserInteractionEnabled = true
			};

			payTextTouched = new UITapGestureRecognizer (PayTextTapped) {
				NumberOfTapsRequired = 1
			};
			payText.AddGestureRecognizer (payTextTouched);

			scrollView.Add (partNameLabel);
			scrollView.Add (priceLabel);
			scrollView.Add (partMakeLabel);
			scrollView.Add (williesGuarentee);
			scrollView.Add (guarenteeOne);
			scrollView.Add (guarenteeTwo);
			scrollView.Add (guarenteeThree);
			scrollView.Add (contactButton);
			scrollView.Add (payButton);
			scrollView.Add (payText);
			scrollView.ContentSize = new CGSize (View.Frame.Width, View.Frame.Height * 1.25);

			View.Add (scrollView);
		}
		public void ViewQualityMetrics(List<iProPQRSPortableLib.Type> Types,List<iProPQRSPortableLib.Option> DropdownOption, string HeaderTitle)
		{
			float hUVB=200;
			UIView finalView=new UIView();
			UIView uvBlock = new UIView ();
			UIImageView titleimg = new UIImageView (new CoreGraphics.CGRect (0, 0, 992, 40));
			titleimg.Image=UIImage.FromFile(@"headerBarTall.png");
			UILabel lbltitle = new UILabel (new CoreGraphics.CGRect (8, 8, 140, 21));
			lbltitle.Text = HeaderTitle;
			uvBlock.Add (titleimg);
			uvBlock.Add (lbltitle);
			float yuvc = 50;
			UIView uvcontrol;
			//mainrootview.RootData.Sort((x,y)=> x.ItemID.CompareTo(y.ItemID));
			Types.Sort((xx,yy)=> xx.Priority.CompareTo(yy.Priority));
			for (int i = 0; i < Types.Count; i++) {

				List<iProPQRSPortableLib.Option> masterMainList = new List<iProPQRSPortableLib.Option>();
				List<iProPQRSPortableLib.Option> masterSubCatList = new List<iProPQRSPortableLib.Option>();


				if (!string.IsNullOrEmpty (Types [i].Label)) {
					uvcontrol = new UIView (new CoreGraphics.CGRect (0, yuvc, 992, 85));				        
					UILabel lblname = new UILabel (new CoreGraphics.CGRect (20, 8, 480, 41));
					lblname.Lines = 3;
					lblname.Text = Types [i].Label;
					string selectedtext = string.Empty;
					string selectedid = string.Empty;
					string selectedsubitemtext = string.Empty;
					string Attriblabel = string.Empty;
					int AttribTypeID=0;

					if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) {						
						var selecteditem = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.Where (u => u.ProcAttribTypeID == Types [i].ProcAttribTypeID ).SingleOrDefault ();
						if (selecteditem != null) {
							AttribTypeID = selecteditem.ProcAttribTypeID;
							Attriblabel = selecteditem.Value;
							string[] arrytxt;
							//var ditem = DropdownOption.Where (u => u.Value == selecteditem.Value && u.ProcAttribTypeID == selecteditem.ProcAttribTypeID).ToList ();
							arrytxt = DropdownOption.Where (u => u.Value == selecteditem.Value && u.ProcAttribTypeID == selecteditem.ProcAttribTypeID).Select (s => s.Description).ToArray ();
							if (arrytxt != null && arrytxt.Length > 0) {
								selectedtext = arrytxt [0];
							}
						}
					}
					int mlpopid = 0;
					int TypeItemID;
					string TypeValue;
					if (Types [i].ProcAttribTypeID == 606) {
						string str = "";
					}
					if (Types [i].ProcAttribTypeID == 605) {
						masterMainList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 686);
						masterSubCatList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 605);
						mlpopid = 686;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[1].ProcAttribTypeID;
							TypeValue=masterMainList[1].Value; 
						}


					} else if (Types [i].ProcAttribTypeID == 607) {
						mlpopid = 685;
						masterMainList = ASA8MasterList;
						masterSubCatList = ASA8SubMasterList;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[1].ProcAttribTypeID;
							TypeValue=masterMainList[1].Value; 
						}

					}
					else if (Types [i].ProcAttribTypeID == 656) {
						mlpopid = 687;
						masterMainList = ASA9MasterList;
						masterSubCatList = ASA9SubMasterList;
						if (masterMainList.Count > 1) {
							TypeItemID=masterMainList[0].ProcAttribTypeID;
							TypeValue=masterMainList[0].Value; 
						}

					}
					else {
						mlpopid = Types [i].ProcAttribTypeID ;
						masterMainList = DropdownOption.FindAll (u => u.ProcAttribTypeID == Types [i].ProcAttribTypeID);
					}
					if (Types [i].ProcAttribTypeID == 605 || Types [i].ProcAttribTypeID == 607 || Types [i].ProcAttribTypeID == 656) {
						//&& Attriblabel=="0582F"
						string str=mlpopid.ToString();
						if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) {
							var	selectedMainListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							if (selectedMainListIDs.Count > 0) {
								string[] arrytxt;
								arrytxt = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Where (u => u.Value == selectedMainListIDs [0].Value && u.ProcAttribTypeID == selectedMainListIDs [0].ProcAttribTypeID).Select (s => s.Description).ToArray ();
								if (arrytxt.Length > 0)
									selectedtext = arrytxt [0];
							}
							var selectedSubCatListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterSubCatList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							if (selectedSubCatListIDs.Count > 0) {
								selectedsubitemtext = selectedsubitemtext + "(";
								foreach (var SIT in selectedSubCatListIDs) {
									string[] arrytxt;
									arrytxt = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Where (u => u.Value == SIT.Value && u.ProcAttribTypeID == SIT.ProcAttribTypeID).Select (s => s.Description).ToArray ();
									if (arrytxt.Length > 0)
										selectedsubitemtext = selectedsubitemtext + arrytxt [0] + ",";
								}
								selectedsubitemtext = selectedsubitemtext.TrimEnd (',') + " )";
								//0582F  "0582F"
								if (selectedMainListIDs.Count > 0 && selectedMainListIDs [0].Value == TypeValue)
									selectedtext = selectedtext + selectedsubitemtext;
							}
						}
					}
					if (Types [i].ProcAttribTypeID == 606) {
						string lbltext = string.Empty;
						if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) {
							var	ASA7MasterList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 606);
							var ASA7N1MasterList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 683);
							var ASA7N2MasterList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 684);

							var selectedMasterASA7OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA7MasterList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							var selectedMasterASA7N1OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA7N1MasterList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							var selectedMasterASA7N2OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA7N2MasterList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							foreach (var item in selectedMasterASA7N1OptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ", ";
								}
							}
							foreach (var item in selectedMasterASA7N2OptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ", ";
								}
							}
							foreach (var item in selectedMasterASA7OptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ",";
								}
							}
							selectedtext = lbltext;
						}
					}

					if (Types [i].ProcAttribTypeID == 607) {
						string lbltext = string.Empty;
						if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) {
							var	ASA8MasterList1 = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 685);
							var ASA8MasterList2 = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 1001);
							var ASA8SubList = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll (x => x.ProcAttribTypeID == 607);

							var selectedASA8MasterList1OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA8MasterList1.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							var selectedASA8MasterList2OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA8MasterList2.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							var selectedMasterSubListOptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (ASA8SubList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList ();
							foreach (var item in selectedASA8MasterList1OptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ", ";
								}
							}
							foreach (var item in selectedASA8MasterList2OptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ", ";
								}
							}
							foreach (var item in selectedMasterSubListOptionsIds) {
								Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value);
								if (opitem != null) {
									lbltext = lbltext + opitem.Description + ",";
								}
							}
							selectedtext = lbltext;
						}
					}

					//if (masterMainList.Count > 0)
					//	mlpopid = Types [i].ProcAttribTypeID;//masterMainList [0].ProcAttribTypeID;
					int tempAttribTypeID = Types [i].ProcAttribTypeID;

					UILabel lblDesc = new UILabel ();
					lblDesc.Lines = 3;
					if (AttribTypeID == 608) {
						if (selectedtext.Contains ("NO Serious adverse event"))
							lblDesc.Text = selectedtext;
						else {
							string finaltext = string.Empty;
							foreach (var sitem in selectednonPqrsTypeAS10OptionsIds) {
								//nonPqrsTypeAS10Options
								var itemtype = nonPqrsTypeAS10Options.Where (u => u.ProcAttribTypeID == sitem).ToList ();
								if (itemtype.Count > 0)
									finaltext = finaltext + itemtype [0].Label + ",";
							}
							if (!string.IsNullOrEmpty (finaltext))
								lblDesc.Text = selectedtext + " ( " + finaltext.TrimEnd (',') + " )";
							else
								lblDesc.Text = selectedtext;
						}
					}
					else
						lblDesc.Text = selectedtext;

					int descwidth = 40;
					lblDesc.Lines = 1;
					if (lblDesc.Text != null) {
						int textcount = lblDesc.Text.Length;
						if (textcount < 58) {
							descwidth = 40;
							lblDesc.Lines = 1;
						} else if (textcount > 58 && textcount <= 114) {
							descwidth = 55;
							lblDesc.Lines = 2;
						} else if (textcount > 114) {
							descwidth = 75;
							lblDesc.Lines = 3;
						}
					}

					lblDesc.Frame = new CoreGraphics.CGRect (500, 8, 480, descwidth);
					if (mlpopid == 608 || mlpopid==624 || mlpopid==606 || mlpopid==615 ) {
						uvcontrol.Frame = new CoreGraphics.CGRect (0, yuvc, 992, 100);
						//lblDesc.Frame = new CoreGraphics.CGRect (500, 0, 480, descwidth);
						yuvc = yuvc + 15;
					}
					lblDesc.Layer.BorderColor = UIColor.Gray.CGColor;
					lblDesc.Layer.BorderWidth = (nfloat)0.5;
					lblDesc.Layer.CornerRadius = (nfloat)8.0; 
					UILabel lblhidenmaincatval = new UILabel ();
					lblhidenmaincatval.Hidden = true;
					lblhidenmaincatval.Text = Attriblabel;
					lblhidenmaincatval.Tag = AttribTypeID;

					UILabel lblhidensubcatval = new UILabel ();
					lblhidensubcatval.Hidden = true;
					UITapGestureRecognizer lblDescTap = new UITapGestureRecognizer( async()  => {
						List<Tuple<string, string>>  selectedrootitem=new List<Tuple<string, string>>();
						if(lblhidenmaincatval.Tag != 0)
							selectedrootitem.Add(new Tuple<string,string>(lblhidenmaincatval.Tag.ToString(),lblhidenmaincatval.Text));//,);
						//string name=Types [i].Label;

						if(mlpopid== 608)
						{
							QualityMetricsASA10 qmasafrm=new QualityMetricsASA10(lblDesc);
							qmasafrm.masterMainList=masterMainList;
							qmasafrm.masterSubCatList=nonPqrsTypeAS10Options;
							if(procedureDetails != null && procedureDetails.ID != 0)
								qmasafrm.ProcID=procedureDetails.ID ;

							qmasafrm.PresentFromPopover(lblDesc, (float)lblDesc.Frame.X, (float)lblDesc.Frame.Y);

							//if(masterMainList.Count>0)
							//	BindmultilevelPopupover(masterMainList,selectedrootitem,selectednonPqrsTypeAS10OptionsIds,lblDesc,(int)lblDesc.Frame.Y,lblhidenmaincatval,true);
						}
						else if(mlpopid== 686 || mlpopid== 685 || mlpopid== 687)
						{ //605=686
							QualityMetricsASA qmasafrm=new QualityMetricsASA(lblDesc);
							qmasafrm.masterMainList=masterMainList;
							qmasafrm.masterSubCatList=masterSubCatList;
							qmasafrm._ValueChanged += delegate {
								if (lblDesc.Text.Trim () != string.Empty){
									foreach (QMValidation item in IsRequiredlabels) {
										if(item.proctAttribTypeID == 606){
											item.lbldesc.Layer.BorderColor = UIColor.Gray.CGColor;
											item.lbldesc.Layer.BorderWidth = 1;
										}
									}
									QMValidation itemToRemove = this.IsRequiredlabels.Find(x => x.proctAttribTypeID == 606 && x.lblname.Trim().ToLower() == "non pqrs");
									asa7ItemRemovedPrev = itemToRemove;
									this.IsRequiredlabels.Remove (itemToRemove);
								}else{
									if(asa7ItemRemovedPrev != null){
										QMValidation searchItem = IsRequiredlabels.Find(x => x.proctAttribTypeID == asa7ItemRemovedPrev.proctAttribTypeID);
										if(searchItem == null){
											IsRequiredlabels.Add(asa7ItemRemovedPrev);
											foreach (QMValidation item in IsRequiredlabels) {
												if(item.proctAttribTypeID == 606){
													item.lbldesc.Layer.BorderColor = UIColor.Red.CGColor;
													item.lbldesc.Layer.BorderWidth = 1;
												}
											}
										}
									}else{
										QMValidation searchItem = IsRequiredlabels.Find(x => x.proctAttribTypeID == 606);
										if(searchItem == null){
											IsRequiredlabels.Add(asa8ItemRemovedPrev);
											foreach (QMValidation item in IsRequiredlabels) {
												if(item.proctAttribTypeID == 606){
													item.lbldesc.Layer.BorderColor = UIColor.Red.CGColor;
													item.lbldesc.Layer.BorderWidth = 1;
												}
											}
										}
									}

								}
							};
							if(procedureDetails != null && procedureDetails.ID != 0)
								qmasafrm.ProcID=procedureDetails.ID ;

							qmasafrm.PresentFromPopover(lblDesc, (float)lblDesc.Frame.X, (float)lblDesc.Frame.Y);

							//if(masterMainList.Count>0)
							//	BindmultilevelPopupover(masterMainList,masterSubCatList,lblDesc,(int)lblDesc.Frame.Y,lblhidenmaincatval,lblhidensubcatval,false,TypeItemID,TypeValue);
						}else if(mlpopid == 606){
							QualityMetricsForm qmFrm = new QualityMetricsForm(lblDesc);
							qmFrm._ValueChanged += delegate {
								if (lblDesc.Text.Trim () != string.Empty) {
									foreach (QMValidation item in IsRequiredlabels) {
										if(item.proctAttribTypeID == 607){
											item.lbldesc.Layer.BorderColor = UIColor.Gray.CGColor;
											item.lbldesc.Layer.BorderWidth = 1;
										}
									}
									QMValidation itemToRemove = this.IsRequiredlabels.Find(x => x.proctAttribTypeID == 607 && x.lblname.Trim().ToLower() == "non pqrs");
									asa8ItemRemovedPrev = itemToRemove;
									this.IsRequiredlabels.Remove (itemToRemove);
								}else{
									if(asa8ItemRemovedPrev != null){
										QMValidation searchItem = IsRequiredlabels.Find(x => x.proctAttribTypeID == asa8ItemRemovedPrev.proctAttribTypeID);
										if(searchItem == null){
											IsRequiredlabels.Add(asa8ItemRemovedPrev);
											foreach (QMValidation item in IsRequiredlabels) {
												if(item.proctAttribTypeID == 607){
													item.lbldesc.Layer.BorderColor = UIColor.Red.CGColor;
													item.lbldesc.Layer.BorderWidth = 1;
												}
											}
										}
									}else{
										QMValidation searchItem = IsRequiredlabels.Find(x => x.proctAttribTypeID == 607);
										if(searchItem == null){
											IsRequiredlabels.Add(asa8ItemRemovedPrev);
											foreach (QMValidation item in IsRequiredlabels) {
												if(item.proctAttribTypeID == 607){
													item.lbldesc.Layer.BorderColor = UIColor.Red.CGColor;
													item.lbldesc.Layer.BorderWidth = 1;
												}
											}
										}
									}
								}
							};

							if(procedureDetails != null && procedureDetails.ID != 0)
								qmFrm.ProcID=procedureDetails.ID ;
							qmFrm.PresentFromPopover(lblDesc, (float)lblDesc.Frame.X, (float)lblDesc.Frame.Y);
						}else{
							if(masterMainList.Count>0)
								qmBindPopupover(masterMainList,lblDesc,(int)lblDesc.Frame.Y,tempAttribTypeID);
						}
						int ProcID=0;
						if(procedureDetails != null && procedureDetails.ID != 0)
							ProcID = procedureDetails.ID;
						iProPQRSPortableLib.Consts.SelectedProcAttribtslist  = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID);

						//IsRequiredlabels


						

					});
					lblDesc.UserInteractionEnabled = true;
					lblDesc.AddGestureRecognizer(lblDescTap);


					//UIButton btncontrol = new UIButton (new CoreGraphics.CGRect (550, 8, 319, 30));
					//if(!string.IsNullOrEmpty(selectedtext))
					//	btncontrol.SetTitle (selectedtext, UIControlState.Normal);
					//btncontrol.SetBackgroundImage (UIImage.FromFile (@"textBoxDropDown.png"), UIControlState.Normal);
					//btncontrol.SetTitleColor (UIColor.Black, UIControlState.Normal);

					//btncontrol.TouchUpInside += async (object sender, EventArgs e) => {
					//	List<string>  selectedi=new List<string>{"selected"};
					//string name=Types [i].Label;
					//	if(AttribTypeID== 608)
					//{
					//if(Dropdownlist.Count>0)
					//BindmultilevelPopupover(Dropdownlist,selectedi,btncontrol,(int)btncontrol.Frame.Y,"name");
					//}
					//else
					//{
					//if(Dropdownlist.Count>0)
					//	BindPopupover(Dropdownlist,selectedi,btncontrol,(int)btncontrol.Frame.Y,"name");
					//}
					//};
					//btncontrol.SetTitle (" btn Name " + i, UIControlState.Normal);

					if (Types [i].IsRequired) {
//						lblDesc.Layer.BorderColor = UIColor.FromRGB (255, 102, 102).CGColor;
						lblDesc.Layer.BorderColor = UIColor.Red.CGColor;
						lblDesc.Layer.BorderWidth = 1;
						QMValidation v=new QMValidation();
						v.lbldesc = lblDesc;
						v.lblname = HeaderTitle;
						v.proctAttribTypeID = Types [i].ProcAttribTypeID;
						IsRequiredlabels.Add(v);
					}

					uvcontrol.Add (lblname);
					if (Types [i].IsRequired) {
						CoreGraphics.CGRect frm = lblname.Frame;
						frm.Width= lblname.IntrinsicContentSize.Width;
						lblname.Frame = frm;
						UILabel lblstar = new UILabel (new CoreGraphics.CGRect (lblname.IntrinsicContentSize.Width+20, 8, 10, 41));
						lblstar.Text = "*";
						lblstar.TextColor = UIColor.Red;
						uvcontrol.Add (lblstar);
					}
					uvcontrol.Add (lblname);
					uvcontrol.Add (lblDesc);	

					qmDisablelbl.Add (lblDesc);
					uvcontrol.Add (lblhidenmaincatval);
					uvcontrol.Add (lblhidensubcatval);
					yuvc = yuvc + 65;
					uvBlock.Add (uvcontrol);
					uvcontrol = null;
				}
			}
			uvBlock.Frame = new CoreGraphics.CGRect (0, 0, 992, yuvc + 45);
			uvBlock.Layer.BorderColor = UIColor.Gray.CGColor;
			uvBlock.Layer.BorderWidth = 1;
			//new CoreGraphics.CGRect(xUV,0,992,hUV
			hUV = yuvc + 45;
			finalView.Frame = new CoreGraphics.CGRect (0,yUV,992, hUV);
			finalView.BackgroundColor = UIColor.White;
			yUV = yUV+hUV+5;
			finalView.Add (uvBlock);
			svQualityMetrics.Add(finalView);

			QMValidation asa7Item = IsRequiredlabels.Find(x => x.proctAttribTypeID == 606);
			QMValidation asa8Item = IsRequiredlabels.Find(x => x.proctAttribTypeID == 607);
			QMValidation asa7ItemToRemove = new QMValidation();
			QMValidation asa8ItemToRemove = new QMValidation();
			foreach (QMValidation item in IsRequiredlabels) {
				if (item.proctAttribTypeID != 0 && item.proctAttribTypeID == 606) {
					if (asa8Item != null) {
						if (asa8Item.lbldesc.Text.Trim () != string.Empty) {
							item.lbldesc.Layer.BorderColor = UIColor.Gray.CGColor;
							item.lbldesc.Layer.BorderWidth = 1;
							asa7ItemToRemove = item;
						}
					}
				}
				if (item.proctAttribTypeID != 0 && item.proctAttribTypeID == 607) {
					if (asa7Item != null) {
						if (asa7Item.lbldesc.Text.Trim () != string.Empty) {
							item.lbldesc.Layer.BorderColor = UIColor.Gray.CGColor;
							item.lbldesc.Layer.BorderWidth = 1;
							asa8ItemToRemove = item;
						}
					}
				}
			}
			if (asa7ItemToRemove.lblname != string.Empty) {
				asa7ItemRemovedPrev = asa7ItemToRemove;
				QMValidation itemToRemove = this.IsRequiredlabels.Find(x => x.proctAttribTypeID == asa7ItemRemovedPrev.proctAttribTypeID && x.lblname.Trim().ToLower() == asa7ItemRemovedPrev.lblname.Trim().ToLower());
				if(itemToRemove != null && itemToRemove.proctAttribTypeID != 0)
					IsRequiredlabels.Remove (itemToRemove);
			}

			if (asa8ItemToRemove.lblname != string.Empty) {
				asa8ItemRemovedPrev = asa8ItemToRemove;
				QMValidation itemToRemove = this.IsRequiredlabels.Find(x => x.proctAttribTypeID == asa8ItemRemovedPrev.proctAttribTypeID && x.lblname.Trim().ToLower() == asa8ItemRemovedPrev.lblname.Trim().ToLower());
				if(itemToRemove != null && itemToRemove.proctAttribTypeID != 0)
					IsRequiredlabels.Remove (itemToRemove);
			}

		}
Exemple #34
0
		void initialize(UIViewController controller)
		{
			var nav = controller as UINavigationController;

			if (nav == null && controller.NavigationController != null)
				nav = controller.NavigationController;

			if (nav != null) {
				navBar = nav.NavigationBar;
				navController = nav;
			}

			var nc = NSNotificationCenter.DefaultCenter;

			observers.Add (nc.AddObserver (UIDevice.OrientationDidChangeNotification, OrientationDidChange));

			rootView = new UIView (controller.View.Bounds);
			rootView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

			controllerView = controller.View;
			controllerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			if (controllerView.Superview != null)
				controllerView.RemoveFromSuperview ();

			rootView.AddSubview (controllerView);

			var statusBarHeight = GetStatusBarHeight ();

			baseView = new UIView (new RectangleF (0, 0, controller.View.Bounds.Width, BAR_HEIGHT + statusBarHeight));

			labelText = new UILabel (new RectangleF (0, statusBarHeight, baseView.Frame.Width - BUTTON_WIDTH, BAR_HEIGHT));
			labelText.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
			labelText.Font = UIFont.SystemFontOfSize (UIFont.SmallSystemFontSize);
			labelText.TextAlignment = UITextAlignment.Center;
			labelText.UserInteractionEnabled = true;
			labelText.Text = lblText;

			buttonClose = new UIButton (UIButtonType.Custom);
			buttonClose.Frame = new RectangleF (labelText.Frame.Right, statusBarHeight, BUTTON_WIDTH, BUTTON_WIDTH);
			buttonClose.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin;

			baseView.AddSubviews (labelText, buttonClose);

			//baseView.Frame = new RectangleF (baseView.Frame.X, baseView.Frame.Y, baseView.Frame.Width, 0f);
			controller.View = rootView;

			controller.View.AddSubview (baseView);
			controller.View.BringSubviewToFront (baseView);

			if (navController != null && navBar != null) {

				navBar.ClipsToBounds = false;
				navController.View.ClipsToBounds = false;

				navController.View.AddSubview (baseView);
				navController.View.BringSubviewToFront (baseView);
			}
			else
				rootView.AddSubview (baseView);
	
			AttachedToController = controller;


			buttonClose.TouchUpInside += delegate {

				var evt = OnClosedRefererOverlay;
				if (evt != null)
					evt();
			};

			tapGestureLabel = new UITapGestureRecognizer (async g => {
				await OpenRefererAppLink(RefererLink);
			});
			labelText.AddGestureRecognizer (tapGestureLabel);

			UpdateColors ();
		}
        public SwipeDelete()
        {
            this.SfGrid                     = new SfDataGrid();
            this.viewModel                  = new SwipingViewModel();
            this.SfGrid.ItemsSource         = viewModel.OrdersInfo;
            this.SfGrid.AutoGenerateColumns = false;
            this.SfGrid.ShowRowHeader       = false;
            this.SfGrid.HeaderRowHeight     = 45;
            this.SfGrid.RowHeight           = 45;
            this.SfGrid.ColumnSizer         = ColumnSizer.Star;

            UILabel leftSwipeViewText = new UILabel();

            leftSwipeViewText.Text            = "Deleted";
            leftSwipeViewText.TextColor       = UIColor.White;
            leftSwipeViewText.TextAlignment   = UITextAlignment.Left;
            leftSwipeViewText.BackgroundColor = UIColor.FromRGB(26, 170, 135);


            UILabel leftSwipeViewButton = new UILabel();

            leftSwipeViewButton.UserInteractionEnabled = true;
            leftSwipeViewButton.Text            = "UNDO";
            leftSwipeViewButton.TextColor       = UIColor.White;
            leftSwipeViewButton.Font            = UIFont.BoldSystemFontOfSize(14);
            leftSwipeViewButton.TextAlignment   = UITextAlignment.Right;
            leftSwipeViewButton.BackgroundColor = UIColor.FromRGB(26, 170, 135);
            leftSwipeViewButton.AddGestureRecognizer(new UITapGestureRecognizer(UndoTapped));

            SwipeView leftSwipeView = new SwipeView();

            leftSwipeView.BackgroundColor = UIColor.FromRGB(26, 170, 135);
            leftSwipeView.AddSubview(leftSwipeViewText);
            leftSwipeView.AddSubview(leftSwipeViewButton);

            UILabel rightSwipeViewText = new UILabel();

            rightSwipeViewText.Text            = "Deleted";
            rightSwipeViewText.TextColor       = UIColor.White;
            rightSwipeViewText.TextAlignment   = UITextAlignment.Left;
            rightSwipeViewText.BackgroundColor = UIColor.FromRGB(26, 170, 135);

            UILabel rightSwipeViewButton = new UILabel();

            rightSwipeViewButton.UserInteractionEnabled = true;
            rightSwipeViewButton.Text            = "UNDO";
            rightSwipeViewButton.TextColor       = UIColor.White;
            rightSwipeViewButton.Font            = UIFont.BoldSystemFontOfSize(14);
            rightSwipeViewButton.TextAlignment   = UITextAlignment.Right;
            rightSwipeViewButton.BackgroundColor = UIColor.FromRGB(26, 170, 135);
            rightSwipeViewButton.AddGestureRecognizer(new UITapGestureRecognizer(UndoTapped));

            SwipeView rightSwipeView = new SwipeView();

            rightSwipeView.BackgroundColor = UIColor.FromRGB(26, 170, 135);
            rightSwipeView.AddSubview(rightSwipeViewText);
            rightSwipeView.AddSubview(rightSwipeViewButton);

            this.SfGrid.AllowSwiping   = true;
            this.SfGrid.LeftSwipeView  = leftSwipeView;
            this.SfGrid.RightSwipeView = rightSwipeView;
            this.SfGrid.SwipeEnded    += SfGrid_SwipeEnded;
            this.SfGrid.SwipeStarted  += SfGrid_SwipeStarted;

            GridTextColumn CustomerID = new GridTextColumn();

            CustomerID.MappingName = "CustomerID";
            CustomerID.HeaderText  = "Customer ID";
            GridTextColumn OrderID = new GridTextColumn();

            OrderID.MappingName = "OrderID";
            OrderID.HeaderText  = "Order ID";
            GridTextColumn EmployeeID = new GridTextColumn();

            EmployeeID.MappingName = "EmployeeID";
            EmployeeID.HeaderText  = "Employee ID";
            GridTextColumn Name = new GridTextColumn();

            Name.MappingName = "FirstName";
            Name.HeaderText  = "Name";

            this.SfGrid.Columns.Add(OrderID);
            this.SfGrid.Columns.Add(CustomerID);
            this.SfGrid.Columns.Add(EmployeeID);
            this.SfGrid.Columns.Add(Name);

            this.AddSubview(SfGrid);
        }
        protected UILabel CreateLabel(string text = null, UITapGestureRecognizer tapGestureRecognizer = null)
        {
            var label = new UILabel {
                                        Text = text,                                      
                                        TextAlignment = UITextAlignment.Left,
                                        Font = UIFont.FromName ("Helvetica-Light", AppDelegate.Font10_5Pt),
                                        TextColor = UIColor.DarkGray,
                                        BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
                                    };

            if (tapGestureRecognizer != null)
            {
                label.UserInteractionEnabled = true;
                label.AddGestureRecognizer(tapGestureRecognizer);
            }

            this.ApplyDebugUIAttributes(label);
            return label;
        }
		public CameraOptions overlaySettings = new CameraOptions(); // default values

		public CameraOverlayView (UIImagePickerController controller, CameraOptions _settings, CGRect frame) : base (frame)
		{
			log ("Intializing Camera Overlay from frame...");
			if(_settings != null)
				overlaySettings = _settings;

			// Clear the background of the overlay:
			this.Opaque = false;  
			this.BackgroundColor = UIColor.Clear;  // transparent

			UIImage overlayGraphic;
			string OverlayImage = _settings.Overlay;

			log ("Overlay Image: "+OverlayImage);
			if (OverlayImage != null && File.Exists("./"+OverlayImage+".png")){
					log ("Overlay Image: "+OverlayImage + " found!");
					overlayGraphic = UIImage.FromBundle (OverlayImage+".png");

			} else {
				log ("Overlay Image not found");
				// Load the image to show in the overlay:
				overlayGraphic = UIImage.FromBundle (@"overlaygraphic.png");
			}
			overlayGraphic = overlayGraphic.ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);  // convert image to template

			UIImageView overlayGraphicView = new UIImageView (overlayGraphic);
			overlayGraphicView.Frame = new CGRect(
				overlaySettings.GuidelinesMargins, 
				overlaySettings.GuidelinesMargins, 
				frame.Width - overlaySettings.GuidelinesMargins * 2 , 
				frame.Height - overlaySettings.GuidelinesMargins * 2);

			log ("guidelines tint color: " + overlaySettings.GuidelinesColorHexadecimal);
			UIColor color = GetUIColorfromHex (overlaySettings.GuidelinesColorHexadecimal);
			if (color != null)
				overlayGraphicView.TintColor = color;

			this.AddSubview (overlayGraphicView);

			ScanButton scanButton = new ScanButton (
				new CGRect ((frame.Width / 2) - (overlaySettings.ScanButtonWidth /2), frame.Height - overlaySettings.ScanButtonHeight - overlaySettings.ScanButtonMarginBottom , 
					overlaySettings.ScanButtonWidth, overlaySettings.ScanButtonHeight), overlaySettings);
			scanButton.TouchUpInside += delegate(object sender, EventArgs e) {

				log("Scan Button TouchUpInside... " );

				controller.TakePicture();
			};

			this.AddSubview (scanButton);

			if (overlaySettings.DescriptionLabelText != null) {
				UILabel label = new UILabel (new CGRect (overlaySettings.DescriptionLabelMarginLeftRight, 
									frame.Height - overlaySettings.DescriptionLabelHeight - overlaySettings.DescriptionLabelMarginBottom, 
					frame.Width - overlaySettings.DescriptionLabelMarginLeftRight * 2, overlaySettings.DescriptionLabelHeight));  // applying "DescriptionLabelMarginLeftRight" margins to width and x position
				label.Text = overlaySettings.DescriptionLabelText;

				color = GetUIColorfromHex (overlaySettings.DescriptionLabelColorHexadecimal);
				if(color != null)
					label.TextColor = color; 
				label.BaselineAdjustment = UIBaselineAdjustment.AlignCenters;
				label.TextAlignment = UITextAlignment.Center; // centered aligned
				label.LineBreakMode = UILineBreakMode.WordWrap; // wrap text by words
				label.Lines = 2;

				if (overlaySettings.DescriptionLabelFontFamilyName != null) {
					UIFont labelFont = UIFont.FromName (overlaySettings.DescriptionLabelFontFamilyName, overlaySettings.DescriptionLabelFontSize);
					if (labelFont != null) {
						label.Font = labelFont;
					} else {
						log ("Font family [" + overlaySettings.DescriptionLabelFontFamilyName + "] for 'DescriptionLabelFontFamilyName' not found");
					}
				}

				this.AddSubview (label);
			}

			UILabel cancelLabel = new UILabel (new CGRect ((frame.Width / 4) - (overlaySettings.CancelButtonWidth /2), 
				frame.Height - overlaySettings.CancelButtonHeight - overlaySettings.ScanButtonMarginBottom, 
				overlaySettings.CancelButtonWidth, overlaySettings.CancelButtonHeight));
			cancelLabel.Text = overlaySettings.CancelButtonText;
			color = GetUIColorfromHex (overlaySettings.CancelButtonColorHexadecimal);
			if(color != null)
				cancelLabel.TextColor = color;
			cancelLabel.BaselineAdjustment = UIBaselineAdjustment.AlignCenters;
			cancelLabel.TextAlignment = UITextAlignment.Center; // centered aligned

			// list of available ios fonts: https://developer.xamarin.com/recipes/ios/standard_controls/fonts/enumerate_fonts/
			if (overlaySettings.CancelButtonFontFamilyName != null) {
				UIFont cancelLabelFont = UIFont.FromName (overlaySettings.CancelButtonFontFamilyName, overlaySettings.CancelButtonFontSize);
				if (cancelLabelFont != null) {
					cancelLabel.Font = cancelLabelFont;
				} else {
					log ("Font family [" + overlaySettings.CancelButtonFontFamilyName + "] for 'CancelButtonFontFamilyName' not found");
				}
			}

			UITapGestureRecognizer cancelLabelTap = new UITapGestureRecognizer(() => {
				log("Cancel Button TouchesEnded... " );
				UIApplication.SharedApplication.InvokeOnMainThread (delegate {
					SystemLogger.Log(SystemLogger.Module.PLATFORM, "Canceled picking image ");
					IPhoneUtils.GetInstance().FireUnityJavascriptEvent("Appverse.Media.onFinishedPickingImage", null);
					IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().DismissModalViewController(true);
				});
			});

			cancelLabel.UserInteractionEnabled = true;
			cancelLabel.AddGestureRecognizer(cancelLabelTap);

			this.AddSubview (cancelLabel);

		}
        void SetupPhotos()
        {
            nfloat height = this.Frame.Size.Height;
            nfloat width = this.Frame.Size.Width;
            cp_mask = new UIView(new CGRect(0, 0, width, height * Constants.CP_RATIO));
            pp_mask = new UIView(new CGRect(width * Constants.PP_X_RATIO, height * Constants.PP_Y_RATIO, height * Constants.PP_RATIO, height * Constants.PP_RATIO));
            pp_circle = new UIView(new CGRect(pp_mask.Frame.Location.X - Constants.PP_BUFF, pp_mask.Frame.Location.Y - Constants.PP_BUFF, pp_mask.Frame.Size.Width + 2 * Constants.PP_BUFF, pp_mask.Frame.Size.Height + 2 * Constants.PP_BUFF));
            pp_circle.BackgroundColor = UIColor.White;
            pp_circle.Layer.CornerRadius = pp_circle.Frame.Size.Height / 2;
            pp_mask.Layer.CornerRadius = pp_mask.Frame.Size.Height / 2;
            cp_mask.BackgroundColor = new UIColor(0.98f, 0.98f, 0.98f, 1);

            nfloat cornerRadius = this.Layer.CornerRadius;
            UIBezierPath maskPath = UIBezierPath.FromRoundedRect(cp_mask.Bounds, UIRectCorner.TopLeft | UIRectCorner.TopRight, new CGSize(cornerRadius, cornerRadius));
            CAShapeLayer maskLayer = new CAShapeLayer();
            maskLayer.Frame = cp_mask.Bounds;
            maskLayer.Path = maskPath.CGPath;
            cp_mask.Layer.Mask = maskLayer;

            UIBlurEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
            visualEffectView = new UIVisualEffectView(blurEffect);
            visualEffectView.Frame = cp_mask.Frame;
            visualEffectView.Alpha = 0;

            profileImageView = new UIImageView();
            profileImageView.Frame = new CGRect(0, 0, pp_mask.Frame.Size.Width, pp_mask.Frame.Size.Height);
            coverImageView = new UIImageView();
            coverImageView.Frame = cp_mask.Frame;
            coverImageView.ContentMode = UIViewContentMode.ScaleAspectFill;

            cp_mask.AddSubview(coverImageView);
            pp_mask.AddSubview(profileImageView);
            cp_mask.ClipsToBounds = true;
            pp_mask.ClipsToBounds = true;

            // setup the label
            nfloat titleLabelX = pp_circle.Frame.Location.X + pp_circle.Frame.Size.Width;
            titleLabel = new UILabel(new CGRect(titleLabelX, cp_mask.Frame.Size.Height + 7, this.Frame.Size.Width - titleLabelX, 26));
            titleLabel.AdjustsFontSizeToFitWidth = false;
            titleLabel.LineBreakMode = UILineBreakMode.Clip;
            titleLabel.Font = UIFont.FromName("HelveticaNeue-Light", 20);
            titleLabel.TextColor = new UIColor(0, 0, 0, 0.8f);
            titleLabel.Text = "Title Label";
            titleLabel.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(this.TitleLabelTap);
            titleLabel.AddGestureRecognizer(tapGesture);
            coverImageView.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGestureCover = new UITapGestureRecognizer(this.CoverPhotoTap);
            coverImageView.AddGestureRecognizer(tapGestureCover);
            profileImageView.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGestureProfile = new UITapGestureRecognizer(this.ProfilePhotoTap);
            profileImageView.AddGestureRecognizer(tapGestureProfile);
            this.AddSubview(titleLabel);
            this.AddSubview(cp_mask);
            this.AddSubview(pp_circle);
            this.AddSubview(pp_mask);
            coverImageView.AddSubview(visualEffectView);
        }
Exemple #39
0
        void getPropertiesInitialization()
        {
            navigationModePicker      = new UIPickerView();
            navigationDirectionPicker = new UIPickerView();
            tabStripPicker            = new UIPickerView();
            PickerModel navigationModeModel = new PickerModel(navigationModeList);

            navigationModePicker.Model = navigationModeModel;
            PickerModel navigationDirectionModel = new PickerModel(navigationDirectionList);

            navigationDirectionPicker.Model = navigationDirectionModel;
            PickerModel tabStripModel = new PickerModel(tabStripPositionList);

            tabStripPicker.Model = tabStripModel;

            //navigationModeLabel
            navigationModeLabel                    = new UILabel();
            navigationModeLabel.Text               = "NavigationStrip Mode";
            navigationModeLabel.Font               = UIFont.FromName("Helvetica", 14f);
            navigationModeLabel.TextColor          = UIColor.Black;
            navigationModeLabel.TextAlignment      = UITextAlignment.Left;
            navigationDirectionLabel               = new UILabel();
            navigationDirectionLabel.Text          = "Navigation Direction";
            navigationDirectionLabel.Font          = UIFont.FromName("Helvetica", 14f);
            navigationDirectionLabel.TextColor     = UIColor.Black;
            navigationDirectionLabel.TextAlignment = UITextAlignment.Left;
            tabStripLabel               = new UILabel();
            tabStripLabel.Text          = "NavigationStrip Position";
            tabStripLabel.Font          = UIFont.FromName("Helvetica", 14f);
            tabStripLabel.TextColor     = UIColor.Black;
            tabStripLabel.TextAlignment = UITextAlignment.Left;

            //navigationModeButton
            navigationModeButton = new UIButton();
            navigationModeButton.SetTitle("Dots", UIControlState.Normal);
            navigationModeButton.Font = UIFont.FromName("Helvetica", 14f);
            navigationModeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationModeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationModeButton.Layer.CornerRadius  = 8;
            navigationModeButton.Layer.BorderWidth   = 2;
            navigationModeButton.TouchUpInside      += ShownavigationModePicker;
            navigationModeButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //navigationDirectionButton
            navigationDirectionButton = new UIButton();
            navigationDirectionButton.SetTitle("Horizontal", UIControlState.Normal);
            navigationDirectionButton.Font = UIFont.FromName("Helvetica", 14f);
            navigationDirectionButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationDirectionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationDirectionButton.Layer.CornerRadius  = 8;
            navigationDirectionButton.Layer.BorderWidth   = 2;
            navigationDirectionButton.TouchUpInside      += ShownavigationDirectionPicker;
            navigationDirectionButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //tabStripButton
            tabStripButton = new UIButton();
            tabStripButton.SetTitle("Bottom", UIControlState.Normal);
            tabStripButton.Font = UIFont.FromName("Helvetica", 14f);
            tabStripButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            tabStripButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            tabStripButton.Layer.CornerRadius  = 8;
            tabStripButton.Layer.BorderWidth   = 2;
            tabStripButton.TouchUpInside      += ShowtabStripPicker;
            tabStripButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //doneButton
            doneButton = new UIButton();
            doneButton.SetTitle("Done\t", UIControlState.Normal);
            doneButton.Font = UIFont.FromName("Helvetica", 14f);
            doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            doneButton.TouchUpInside      += HidePicker;
            doneButton.Hidden          = true;
            doneButton.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            //picker
            navigationModeModel.PickerChanged               += navigationModeSelectedIndexChanged;
            navigationDirectionModel.PickerChanged          += navigationDirectionSelectedIndexChanged;
            tabStripModel.PickerChanged                     += tabStripSelectedIndexChanged;
            navigationModePicker.ShowSelectionIndicator      = true;
            navigationModePicker.Hidden                      = true;
            navigationModePicker.BackgroundColor             = UIColor.Gray;
            navigationDirectionPicker.BackgroundColor        = UIColor.Gray;
            navigationDirectionPicker.ShowSelectionIndicator = true;
            navigationDirectionPicker.Hidden                 = true;
            tabStripPicker.BackgroundColor                   = UIColor.Gray;
            tabStripPicker.ShowSelectionIndicator            = true;
            tabStripPicker.Hidden = true;

            //autoPlayLabel
            autoPlayLabel                 = new UILabel();
            autoPlayLabel.TextColor       = UIColor.Black;
            autoPlayLabel.BackgroundColor = UIColor.Clear;
            autoPlayLabel.Text            = @"Enable AutoPlay";
            autoPlayLabel.TextAlignment   = UITextAlignment.Left;
            autoPlayLabel.Font            = UIFont.FromName("Helvetica", 14f);
            //allowSwitch
            autoPlaySwitch = new UISwitch();
            autoPlaySwitch.ValueChanged += autoPlayToggleChanged;
            autoPlaySwitch.On            = false;
            autoPlaySwitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);

            controlView.AddSubview(rotator);
            this.AddSubview(controlView);

            sub_View           = new UIView();
            propertiesLabel    = new UILabel();
            closeButton        = new UIButton();
            showPropertyButton = new UIButton();

            //adding to content view
            contentView.AddSubview(navigationModeLabel);
            contentView.AddSubview(navigationModeButton);
            contentView.AddSubview(navigationDirectionLabel);
            contentView.AddSubview(navigationDirectionButton);
            contentView.AddSubview(tabStripLabel);
            contentView.AddSubview(tabStripButton);
            contentView.AddSubview(autoPlayLabel);
            contentView.AddSubview(autoPlaySwitch);
            contentView.AddSubview(doneButton);
            contentView.AddSubview(navigationModePicker);
            contentView.AddSubview(tabStripPicker);
            contentView.AddSubview(navigationDirectionPicker);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            //adding to sub_view
            sub_View.AddSubview(contentView);
            sub_View.AddSubview(closeButton);
            sub_View.AddSubview(propertiesLabel);
            sub_View.BackgroundColor = UIColor.FromRGB(230, 230, 230);
            this.AddSubview(sub_View);
            propertiesLabel.Text = "OPTIONS";

            //showPropertyButton
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle("OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            showPropertyButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            showPropertyButton.TouchUpInside += (object sender, EventArgs e) => {
                sub_View.Hidden           = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);

            //CloseButton
            closeButton.SetTitle("X\t", UIControlState.Normal);
            closeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            closeButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            closeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            closeButton.TouchUpInside += (object sender, EventArgs e) => {
                sub_View.Hidden           = true;
                showPropertyButton.Hidden = false;
            };

            //AddingGesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() => {
                sub_View.Hidden           = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertiesLabel.UserInteractionEnabled = true;
            propertiesLabel.AddGestureRecognizer(tapgesture);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            BTProgressHUD.Dismiss ();

            activeField = ActiveField.Player;
            Round = AppDelegate.Self.ApiClient.Get (new GetRound { Id = AppDelegate.Self.CurrentRoundId });
            Machines = AppDelegate.Self.ApiClient.Get (new GetMachinesInRound { Id = Round.Id });
            if (Machines.Count == 0)
                AppDelegate.Self.ShowModalAlertViewAsync ("No games found.");

            _backgroundViewHeight = UIScreen.MainScreen.Bounds.Height;
            _backgroundViewWidth = UIScreen.MainScreen.Bounds.Width;

            labelh = 50.0f;

            nfloat labelx = 70;
            nfloat labely = 120;

            playerLabel = new UILabel {
                Text = "Player",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.White,
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            playerLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(playerLabel);
                }));

            playerNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                Hidden = true
            };
            playerNameLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 20, labely, 400, labelh),
                Hidden = true
            };

            inputField = new UITextField
            {
                Placeholder = "|",
                BackgroundColor = UIColor.FromRGB(41, 57, 69),
                TextColor = UIColor.White,
                Font = UIFont.FromName ("Arial", 30F),
                BorderStyle = UITextBorderStyle.RoundedRect,
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                UserInteractionEnabled = false,
                TextAlignment = UITextAlignment.Center
            };

            labely += 140;
            gameLabel = new UILabel {
                Text = "Game",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16f),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            gameLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(gameLabel);
                }));

            gameNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                Hidden = false
            };
            gameNameLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 20, labely, 400, labelh),
                Hidden = false
            };

            labely += 140;
            scoreLabel = new UILabel {
                Text = "Score",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16f),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            scoreLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(scoreLabel);
                }));

            scoreNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 300, labelh),
                Hidden = true
            };

            labely += 100;
            savedLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(48, 202, 102),
                Text = "Score submitted successfully",
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 300, labelh),
                Hidden = true
            };

            View.AddSubview(playerLabel);
            View.AddSubview(playerNumberLabel);
            View.AddSubview(playerNameLabel);
            View.AddSubview(gameLabel);
            View.AddSubview(gameNumberLabel);
            View.AddSubview(gameNameLabel);
            View.AddSubview(scoreLabel);
            View.AddSubview(scoreNumberLabel);
            View.AddSubview(savedLabel);
            View.AddSubview(inputField);

            drawButtons ();

            if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || InterfaceOrientation == UIInterfaceOrientation.LandscapeRight)
            {
                _heightFix = View.Bounds.Width;
                DidRotate (UIInterfaceOrientation.Portrait);
            }
        }
Exemple #41
0
        public void loadOptionView()
        {
            subView             = new UIScrollView();
            subView.ContentSize = new CGSize(Frame.Width, 400);

            //autoReverse
            autoReverse                 = new UILabel();
            autoReverse.TextColor       = UIColor.Black;
            autoReverse.BackgroundColor = UIColor.Clear;
            autoReverse.Text            = @"Auto Reverse";
            autoReverse.TextAlignment   = UITextAlignment.Left;
            autoReverse.Font            = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(autoReverse);

            //autoSwitch
            autoSwitch = new UISwitch();
            autoSwitch.ValueChanged += autoReverseToggleChanged;
            autoSwitch.On            = false;
            autoSwitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);
            contentView.AddSubview(autoSwitch);

            //spinLabel
            spinLabel                 = new UILabel();
            spinLabel.TextColor       = UIColor.Black;
            spinLabel.BackgroundColor = UIColor.Clear;
            spinLabel.Text            = @"Spin Alignment";
            spinLabel.TextAlignment   = UITextAlignment.Left;
            spinLabel.Font            = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(spinLabel);

            //spinAlignmentButton
            spinAlignmentButton = new UIButton();
            spinAlignmentButton.SetTitle("Right", UIControlState.Normal);
            spinAlignmentButton.Font = UIFont.FromName("Helvetica", 14f);
            spinAlignmentButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            spinAlignmentButton.BackgroundColor     = UIColor.Clear;
            spinAlignmentButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            spinAlignmentButton.Hidden             = false;
            spinAlignmentButton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            spinAlignmentButton.Layer.BorderWidth  = 4;
            spinAlignmentButton.Layer.CornerRadius = 8;
            spinAlignmentButton.TouchUpInside     += ShowSpinPicker;
            contentView.AddSubview(spinAlignmentButton);

            //minimumLabel
            minimumLabel               = new UILabel();
            minimumLabel.Text          = "Minimum";
            minimumLabel.TextColor     = UIColor.Black;
            minimumLabel.TextAlignment = UITextAlignment.Left;
            minimumLabel.Font          = UIFont.FromName("Helvetica", 14f);

            //maximumLabel
            maximumLabel               = new UILabel();
            maximumLabel.Text          = "Maximum";
            maximumLabel.TextColor     = UIColor.Black;
            maximumLabel.TextAlignment = UITextAlignment.Left;
            maximumLabel.Font          = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(minimumLabel);
            contentView.AddSubview(maximumLabel);

            //minimumText
            minimumText = new UITextView();
            minimumText.TextAlignment     = UITextAlignment.Center;
            minimumText.Layer.BorderColor = UIColor.Black.CGColor;
            minimumText.BackgroundColor   = UIColor.FromRGB(246, 246, 246);
            minimumText.KeyboardType      = UIKeyboardType.NumberPad;
            minimumText.Text     = "0";
            minimumText.Font     = UIFont.FromName("Helvetica", 14f);
            minimumText.Changed += (object sender, EventArgs e) =>
            {
                if (minimumText.Text.Length > 0)
                {
                    adultNumericUpDown.Minimum   = nfloat.Parse(minimumText.Text);
                    infantsNumericUpDown.Minimum = nfloat.Parse(minimumText.Text);
                }
            };
            contentView.AddSubview(minimumText);

            //maximumText
            maximumText = new UITextView();
            maximumText.TextAlignment     = UITextAlignment.Center;
            maximumText.Layer.BorderColor = UIColor.Black.CGColor;
            maximumText.BackgroundColor   = UIColor.FromRGB(246, 246, 246);
            maximumText.KeyboardType      = UIKeyboardType.NumberPad;
            maximumText.Text     = "100";
            maximumText.Font     = UIFont.FromName("Helvetica", 14f);
            maximumText.Changed += (object sender, EventArgs e) =>
            {
                if (maximumText.Text.Length > 0)
                {
                    adultNumericUpDown.Maximum   = nfloat.Parse(maximumText.Text);
                    infantsNumericUpDown.Maximum = nfloat.Parse(maximumText.Text);
                }
            };
            contentView.AddSubview(maximumText);

            //spinPicker
            PickerModel culturePickermodel = new PickerModel(this.cultureList);

            culturePickermodel.PickerChanged += (sender, e) =>
            {
                this.cultureSelectedType = e.SelectedValue;
                spinAlignmentButton.SetTitle(cultureSelectedType, UIControlState.Normal);
                if (cultureSelectedType == "Right")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Right;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Right;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Left;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Left;
                }
                else if (cultureSelectedType == "Left")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Left;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Left;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Right;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Right;
                }
                else if (cultureSelectedType == "Both")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Both;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Both;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Center;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Center;
                }
            };
            spinPicker = new UIPickerView();
            spinPicker.ShowSelectionIndicator = true;
            spinPicker.Hidden          = true;
            spinPicker.Model           = culturePickermodel;
            spinPicker.BackgroundColor = UIColor.Gray;
            contentView.AddSubview(spinPicker);

            //cultureDoneButton
            cultureDoneButton = new UIButton();
            cultureDoneButton.SetTitle("Done\t", UIControlState.Normal);
            cultureDoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            cultureDoneButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            cultureDoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            cultureDoneButton.Hidden         = true;
            cultureDoneButton.Font           = UIFont.FromName("Helvetica", 14f);
            cultureDoneButton.TouchUpInside += HideSpinPicker;
            contentView.AddSubview(cultureDoneButton);

            //propertyLabel
            propertyLabel      = new UILabel();
            propertyLabel.Text = "OPTIONS";
            subView.AddSubview(propertyLabel);
            subView.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);
            subView.AddSubview(contentView);
            this.AddSubview(subView);

            //ShowPropertyButton
            showPropertyButton        = new UIButton();
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle(" OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            showPropertyButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            showPropertyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);


            //closeButton
            closeButton = new UIButton();
            closeButton.SetTitle("X\t", UIControlState.Normal);
            closeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            closeButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            closeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            closeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;;
            };
            subView.AddSubview(closeButton);

            //Adding Gesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertyLabel.UserInteractionEnabled = true;
            propertyLabel.AddGestureRecognizer(tapgesture);
        }
        /// <summary>
        /// Views the did load.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            //
             m_navigationTitle = @"Audio Recorder";

            //
            this.View.TintColor = NormalTintColor;
            mMusicFlowView.BackgroundColor = this.View.BackgroundColor;
            mMusicFlowView.IdleAmplitude = 0;

            //Unique recording URL
            var fileName = NSProcessInfo.ProcessInfo.GloballyUniqueString;

            var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
            var tmp = Path.Combine (documents, "..", "tmp");

            m_recordingFilePath = Path.Combine(tmp,String.Format("{0}.m4a",fileName));
             {

                m_flexItem1 = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace,null,null);
                m_flexItem2 = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace,null,null);

                var img = UIImage.FromBundle("audio_record");

                m_recordButton = new UIBarButtonItem(img,UIBarButtonItemStyle.Plain,RecordingButtonAction);
                m_playButton = new UIBarButtonItem(UIBarButtonSystemItem.Play,PlayAction);
                m_pauseButton = new UIBarButtonItem(UIBarButtonSystemItem.Pause,PauseAction);
                m_trashButton = new UIBarButtonItem(UIBarButtonSystemItem.Trash,DeleteAction);

                this.SetToolbarItems (new UIBarButtonItem[]{ m_playButton, m_flexItem1, m_recordButton, m_flexItem2, m_trashButton}, false);

                 m_playButton.Enabled = false;
                 m_trashButton.Enabled = false;
             }

             // Define the recorder setting
             {
                var audioSettings = new AudioSettings () {
                    Format = AudioFormatType.MPEG4AAC,
                    SampleRate = 44100.0f,
                    NumberChannels = 2,
                };

                NSError err = null;

                m_audioRecorder = AVAudioRecorder.Create (NSUrl.FromFilename (m_recordingFilePath), audioSettings,out err);

                // Initiate and prepare the recorder
                m_audioRecorder.WeakDelegate = this;
                m_audioRecorder.MeteringEnabled = true;

                mMusicFlowView.PrimaryWaveLineWidth = 3.0f;
                mMusicFlowView.SecondaryWaveLineWidth = 1.0f;
             }

             //Navigation Bar Settings
             {
                this.NavigationItem.Title = @"Audio Recorder";
                m_cancelButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel,CancelAction);
                this.NavigationItem.LeftBarButtonItem = m_cancelButton;

                m_doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, DoneAction);
             }

             //Player Duration View
            {
                m_viewPlayerDuration = new UIView ();
                m_viewPlayerDuration.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
                m_viewPlayerDuration.BackgroundColor = UIColor.Clear;

                m_labelCurrentTime = new UILabel ();
                m_labelCurrentTime.Text = NSStringExtensions.TimeStringForTimeInterval (0);
                m_labelCurrentTime.Font =  UIFont.BoldSystemFontOfSize(14.0f);
                m_labelCurrentTime.TextColor = NormalTintColor;
                m_labelCurrentTime.TranslatesAutoresizingMaskIntoConstraints = false;

                m_playerSlider = new UISlider(new CGRect(0, 0, this.View.Bounds.Size.Width, 64));
                 m_playerSlider.MinimumTrackTintColor = PlayingTintColor;
                 m_playerSlider.Value = 0;

                m_playerSlider.TouchDown += SliderStart;
                m_playerSlider.ValueChanged += SliderMoved;
                m_playerSlider.TouchUpInside += SliderEnd;
                m_playerSlider.TouchUpOutside += SliderEnd;
                 m_playerSlider.TranslatesAutoresizingMaskIntoConstraints = false;

                m_labelRemainingTime = new UILabel();
                m_labelCurrentTime.Text = NSStringExtensions.TimeStringForTimeInterval (0);
                 m_labelRemainingTime.UserInteractionEnabled = true;
                m_labelRemainingTime.AddGestureRecognizer (new UITapGestureRecognizer(TapRecognizer));
                m_labelRemainingTime.Font = m_labelCurrentTime.Font;
                 m_labelRemainingTime.TextColor = m_labelCurrentTime.TextColor;
                 m_labelRemainingTime.TranslatesAutoresizingMaskIntoConstraints = false;

                m_viewPlayerDuration.Add (m_labelCurrentTime);
                m_viewPlayerDuration.Add (m_playerSlider);
                m_viewPlayerDuration.Add (m_labelRemainingTime);

                NSLayoutConstraint constraintCurrentTimeLeading = NSLayoutConstraint.Create (m_labelCurrentTime,NSLayoutAttribute.Leading,NSLayoutRelation.Equal,m_viewPlayerDuration,NSLayoutAttribute.Leading,1.0f, 10.0f);
                NSLayoutConstraint constraintCurrentTimeTrailing =  NSLayoutConstraint.Create (m_playerSlider,NSLayoutAttribute.Leading,NSLayoutRelation.Equal,m_labelCurrentTime,NSLayoutAttribute.Trailing,1.0f,10);

                NSLayoutConstraint constraintRemainingTimeLeading =  NSLayoutConstraint.Create (m_labelRemainingTime,NSLayoutAttribute.Leading,NSLayoutRelation.Equal,m_playerSlider,NSLayoutAttribute.Trailing,1.0f, 10.0f);
                NSLayoutConstraint constraintRemainingTimeTrailing =  NSLayoutConstraint.Create (m_viewPlayerDuration,NSLayoutAttribute.Trailing,NSLayoutRelation.Equal,m_labelRemainingTime,NSLayoutAttribute.Trailing,1.0f,10.0f);

                NSLayoutConstraint constraintCurrentTimeCenter = NSLayoutConstraint.Create (m_labelCurrentTime,NSLayoutAttribute.CenterY,NSLayoutRelation.Equal,m_viewPlayerDuration,NSLayoutAttribute.CenterY,1.0f,0.0f);

                NSLayoutConstraint constraintSliderCenter = NSLayoutConstraint.Create (m_playerSlider,NSLayoutAttribute.CenterY,NSLayoutRelation.Equal,m_viewPlayerDuration,NSLayoutAttribute.CenterY,1.0f,0.0f);

                NSLayoutConstraint constraintRemainingTimeCenter = NSLayoutConstraint.Create (m_labelRemainingTime,NSLayoutAttribute.CenterY,NSLayoutRelation.Equal,m_viewPlayerDuration,NSLayoutAttribute.CenterY,1.0f,0.0f);

                m_viewPlayerDuration.AddConstraints(new NSLayoutConstraint[]{constraintCurrentTimeLeading,constraintCurrentTimeTrailing,constraintRemainingTimeLeading,constraintRemainingTimeTrailing,constraintCurrentTimeCenter,constraintSliderCenter,constraintRemainingTimeCenter});

            }
        }