void ReleaseDesignerOutlets()
        {
            if (AboutImageView != null)
            {
                AboutImageView.Dispose();
                AboutImageView = null;
            }

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

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

            if (VersionLabel != null)
            {
                VersionLabel.Dispose();
                VersionLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutImage != null)
            {
                AboutImage.Dispose();
                AboutImage = null;
            }

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

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

            if (copyright != null)
            {
                copyright.Dispose();
                copyright = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

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

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

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

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

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

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

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

            if (BlogRssButton != null)
            {
                BlogRssButton.Dispose();
                BlogRssButton = null;
            }
        }
        protected void OnDeviceRotated(NSNotification notification)
        {
            if (AppDelegate.IsPad)
            {
                SizeF size;
                if (IsPortrait)
                {
                    XamLogoImageView.Image = UIImage.FromBundle("/Images/About-Portrait~iPad");
                    ScrollView.ContentSize = new SizeF(768, 1004);

                    size = AboutTextView.StringSize(AboutTextView.Text
                                                    , AboutTextView.Font
                                                    , new SizeF(738, 500)
                                                    , UILineBreakMode.WordWrap);

                    AboutTextView.Frame = new RectangleF(
                        15,
                        650,
                        size.Width,
                        size.Height + 30);
                }
                else
                {
                    // IsLandscape
                    XamLogoImageView.Image = UIImage.FromBundle("/Images/About-Landscape~iPad");
                    ScrollView.ContentSize = new SizeF(1024, 748);

                    size = AboutTextView.StringSize(AboutTextView.Text
                                                    , AboutTextView.Font
                                                    , new SizeF(1004, 500)
                                                    , UILineBreakMode.WordWrap);

                    AboutTextView.Frame = new RectangleF(
                        15,
                        500,
                        size.Width,
                        size.Height + 30);
                }
                var Y = AboutTextView.Frame.Y + size.Height + 30;
                LayoutButtons(Y);
            }
        }
Пример #5
0
 void ReleaseDesignerOutlets()
 {
     if (AboutTextView != null)
     {
         AboutTextView.Dispose();
         AboutTextView = null;
     }
     if (CurrencyTextField != null)
     {
         CurrencyTextField.Dispose();
         CurrencyTextField = null;
     }
     if (testTextView != null)
     {
         testTextView.Dispose();
         testTextView = null;
     }
     if (VisitSiteButton != null)
     {
         VisitSiteButton.Dispose();
         VisitSiteButton = null;
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "About Xamarin";

            StackOverflowButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_stackoverflow.png"), UIControlState.Normal);
            LinkedInButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_linkedin.png"), UIControlState.Normal);
            TwitterButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_twitter.png"), UIControlState.Normal);
            YouTubeButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_youtube.png"), UIControlState.Normal);
            FacebookButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_facebook.png"), UIControlState.Normal);
            BlogRssButton.SetBackgroundImage(UIImage.FromFile("Images/Logos/logo_rss.png"), UIControlState.Normal);


            StackOverflowButton.TouchUpInside += (sender, e) => { OpenUrl(Constants.AboutUrlStackOverflow); };
            LinkedInButton.TouchUpInside      += (sender, e) => { OpenUrl(Constants.AboutUrlLinkedIn); };
            TwitterButton.TouchUpInside       += (sender, e) => { OpenUrl(Constants.AboutUrlTwitter); };
            YouTubeButton.TouchUpInside       += (sender, e) => { OpenUrl(Constants.AboutUrlYouTube); };
            FacebookButton.TouchUpInside      += (sender, e) => { OpenUrl(Constants.AboutUrlFacebook); };
            BlogRssButton.TouchUpInside       += (sender, e) => { OpenUrl(Constants.AboutUrlBlogRss); };


            if (AppDelegate.IsPhone)
            {
                ScrollView.Frame       = new RectangleF(0, 43, 320, 367);
                ScrollView.ContentSize = new SizeF(320, 610);

                XamLogoImageView.Image = UIImage.FromBundle("/Images/About");

                AboutTextView.Frame = new RectangleF(
                    AboutTextView.Frame.X,
                    AboutTextView.Frame.Y,
                    320,
                    240);

                var Y = AboutTextView.Frame.Y + 240;

                StackOverflowButton.Frame = new RectangleF(StackOverflowButton.Frame.X, Y, StackOverflowButton.Frame.Width, StackOverflowButton.Frame.Height);
                LinkedInButton.Frame      = new RectangleF(LinkedInButton.Frame.X, Y, LinkedInButton.Frame.Width, LinkedInButton.Frame.Height);
                TwitterButton.Frame       = new RectangleF(TwitterButton.Frame.X, Y, TwitterButton.Frame.Width, TwitterButton.Frame.Height);
                YouTubeButton.Frame       = new RectangleF(YouTubeButton.Frame.X, Y, YouTubeButton.Frame.Width, YouTubeButton.Frame.Height);
                FacebookButton.Frame      = new RectangleF(FacebookButton.Frame.X, Y, FacebookButton.Frame.Width, FacebookButton.Frame.Height);
                BlogRssButton.Frame       = new RectangleF(BlogRssButton.Frame.X, Y, BlogRssButton.Frame.Width, BlogRssButton.Frame.Height);
            }
            else
            {
                // IsPad
                ScrollView.Frame       = new RectangleF(0, 0, 768, 1004);
                ScrollView.ContentSize = new SizeF(768, 1024);

                XamLogoImageView.Image = UIImage.FromBundle("/Images/About-Portrait~iPad");
                XamLogoImageView.Frame = ScrollView.Frame;

                SizeF size = AboutTextView.StringSize(AboutTextView.Text
                                                      , AboutTextView.Font
                                                      , new SizeF(738, 500)
                                                      , UILineBreakMode.WordWrap);

                AboutTextView.Frame = new RectangleF(
                    15,
                    650,
                    size.Width,
                    size.Height + 30);
                //AboutTextView.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleWidth;

                var Y = AboutTextView.Frame.Y + size.Height + 40;

                StackOverflowButton.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
                LinkedInButton.AutoresizingMask      = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
                TwitterButton.AutoresizingMask       = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
                YouTubeButton.AutoresizingMask       = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
                BlogRssButton.AutoresizingMask       = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
                FacebookButton.AutoresizingMask      = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;

                LayoutButtons(Y);
            }
            AboutTextView.Text = Constants.AboutText;             // @"Xamarin was founded in 2011 with the mission to make it fast, easy and fun to build great mobile apps. Xamarin’s products are used by individual developers and companies, including VMware, Target, Rdio, Medtronic and Unity Technologies, to simplify creation and operation of high-performance, cross-platform mobile consumer and corporate applications, targeting phones and tablets running iOS, Android and Windows. For more information, visit http://xamarin.com.";
        }