private void InitBindings() { ViewModel.PropertyChanged += (object sender, PropertyChangedEventArgs e) => { if (e.PropertyName.Equals("CharacterCount")) { CountLabel.Text = ViewModel.CharacterCount; } }; this.SetBinding( () => TextView.Text, () => ViewModel.Message, BindingMode.TwoWay ).UpdateSourceTrigger("Changed"); this.SetBinding( () => FacebookButton.Selected, () => ViewModel.IsFacebookSelected, BindingMode.TwoWay ).UpdateSourceTrigger("TouchUpInside"); this.SetBinding( () => TwitterButton.Selected, () => ViewModel.IsTwitterSelected, BindingMode.TwoWay ).UpdateSourceTrigger("TouchUpInside"); ViewModel.CanExecute = OnCanExecute; ViewModel.RequestDismissPage = OnRequestDismissPage; PostButton.SetCommand("TouchUpInside", ViewModel.PostCommand); TwitterButton.SetCommand("TouchUpInside", ViewModel.TwitterCommand); FacebookButton.SetCommand("TouchUpInside", ViewModel.FacebookCommand); }
private async void OnTwitterAuthCompleted(object sender, AuthenticatorCompletedEventArgs e) { this.DismissViewController(true, null); var twitterService = new TwitterService(); var email = await twitterService.GetEmailAsync("6ozsrJfgvSe58Pl45MLk65PfH", "tneY3Wf4hxpFM8UpuSvw9bhy6P9vF11KUS731Suk2xmkGPUZgB", e.Account.Properties["oauth_token"], e.Account.Properties["oauth_token_secret"]); TwitterButton.SetTitle(email, UIControlState.Normal); }
public StatisticsCard() : base(".\\Sprites\\GUI\\statisticsCard") { backShape = new StaticObject(".\\Sprites\\GUI\\backPauseShape"); twButton = new TwitterButton(null); fbButton = new FBButton(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; } }
void ReleaseDesignerOutlets() { if (FacebookButton != null) { FacebookButton.Dispose(); FacebookButton = null; } if (GithubButton != null) { GithubButton.Dispose(); GithubButton = null; } if (GoogleButton != null) { GoogleButton.Dispose(); GoogleButton = null; } if (LinkedinButton != null) { LinkedinButton.Dispose(); LinkedinButton = null; } if (PinterestButton != null) { PinterestButton.Dispose(); PinterestButton = null; } if (TwitterButton != null) { TwitterButton.Dispose(); TwitterButton = null; } if (WatsappButton != null) { WatsappButton.Dispose(); WatsappButton = null; } if (Image != null) { Image.Dispose(); Image = null; } if (Label != null) { Label.Dispose(); Label = null; } }
private void InitUI() { // Setup UI elements InitSocialButton(FacebookButton); InitSocialButton(TwitterButton); var bubbleCenterYConstraint = 0; GoButton.Layer.CornerRadius = 6; GoButton.Layer.BorderColor = ThemeManager.Instance.CurrentTheme.Disabled.ToUIColor().CGColor; GoButton.Layer.BorderWidth = 1; // Animations View.SetNeedsLayout(); TitleImageViewTopConstraint.Constant = 46; FacebookButton.Alpha = 0; TwitterButton.Alpha = 0; GoButton.Alpha = 0; SubtitleLabel.Alpha = 0; UIView.AnimateNotify(0.75, () => { View.LayoutIfNeeded(); SubtitleLabel.Alpha = 1; }, (ic) => { FacebookButton.SetNeedsLayout(); FacebookButtonCenterYConstraint.Constant = bubbleCenterYConstraint; UIView.AnimateNotify(1, 0, 0.4f, 1, 0, () => { FacebookButton.LayoutIfNeeded(); FacebookButton.Alpha = 1; }, (ic1) => { TwitterButton.SetNeedsLayout(); TwitterButtonCenterYConstraint.Constant = bubbleCenterYConstraint; UIView.AnimateNotify(1, 0, 0.4f, 1, 0, () => { TwitterButton.LayoutIfNeeded(); TwitterButton.Alpha = 1; }, (ic2) => { UIView.AnimateNotify(0.5, () => { GoButtonBottomConstraint.Constant = 26; GoButton.Alpha = 1; }, null); }); }); }); }
void ReleaseDesignerOutlets() { if (FacebookButton != null) { FacebookButton.Dispose(); FacebookButton = null; } if (InstagramButton != null) { InstagramButton.Dispose(); InstagramButton = null; } if (LinkedinButton != null) { LinkedinButton.Dispose(); LinkedinButton = null; } if (PrivacyPolicyButton != null) { PrivacyPolicyButton.Dispose(); PrivacyPolicyButton = null; } if (SeekiosButton != null) { SeekiosButton.Dispose(); SeekiosButton = null; } if (TwitterButton != null) { TwitterButton.Dispose(); TwitterButton = null; } if (VersionLabel != null) { VersionLabel.Dispose(); VersionLabel = null; } }
private void InitBindings() { ViewModel.PropertyChanged += (object sender, PropertyChangedEventArgs e) => { if (e.PropertyName.Equals("IsFacebookSelected")) { OnSocialButtonSelected(FacebookButton, ViewModel.IsFacebookSelected); } else if (e.PropertyName.Equals("IsTwitterSelected")) { OnSocialButtonSelected(TwitterButton, ViewModel.IsTwitterSelected); } }; FacebookButton.SetCommand("TouchUpInside", ViewModel.FacebookCommand); TwitterButton.SetCommand("TouchUpInside", ViewModel.TwitterCommand); ViewModel.RequestHomePage = OnRequestHomePage; ViewModel.CanExecute = OnCanExecute; }
void ReleaseDesignerOutlets() { if (ActivityIndicator != null) { ActivityIndicator.Dispose(); ActivityIndicator = null; } if (BackgroundImageView != null) { BackgroundImageView.Dispose(); BackgroundImageView = null; } if (FacebookButton != null) { FacebookButton.Dispose(); FacebookButton = null; } if (GoButton != null) { GoButton.Dispose(); GoButton = null; } if (GoButtonBottomConstraint != null) { GoButtonBottomConstraint.Dispose(); GoButtonBottomConstraint = null; } if (SubtitleLabel != null) { SubtitleLabel.Dispose(); SubtitleLabel = null; } if (TitleImageView != null) { TitleImageView.Dispose(); TitleImageView = null; } if (TitleImageViewTopConstraint != null) { TitleImageViewTopConstraint.Dispose(); TitleImageViewTopConstraint = null; } if (TwitterButton != null) { TwitterButton.Dispose(); TwitterButton = null; } if (FacebookButtonCenterYConstraint != null) { FacebookButtonCenterYConstraint.Dispose(); FacebookButtonCenterYConstraint = null; } if (TwitterButtonCenterYConstraint != null) { TwitterButtonCenterYConstraint.Dispose(); TwitterButtonCenterYConstraint = null; } }
void ReleaseDesignerOutlets() { if (BackgroundImageView != null) { BackgroundImageView.Dispose(); BackgroundImageView = null; } if (CountLabel != null) { CountLabel.Dispose(); CountLabel = null; } if (FacebookButton != null) { FacebookButton.Dispose(); FacebookButton = null; } if (FacebookTrailingConstraint != null) { FacebookTrailingConstraint.Dispose(); FacebookTrailingConstraint = null; } if (FooterView != null) { FooterView.Dispose(); FooterView = null; } if (FooterViewBottomConstraint != null) { FooterViewBottomConstraint.Dispose(); FooterViewBottomConstraint = null; } if (PostButton != null) { PostButton.Dispose(); PostButton = null; } if (TextView != null) { TextView.Dispose(); TextView = null; } if (TwitterButton != null) { TwitterButton.Dispose(); TwitterButton = null; } if (TwitterTrailingConstraint != null) { TwitterTrailingConstraint.Dispose(); TwitterTrailingConstraint = null; } if (AccountsView != null) { AccountsView.Dispose(); AccountsView = 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 CGRect(0, 43, 320, 367); ScrollView.ContentSize = new CGSize(320, 610); XamLogoImageView.Image = UIImage.FromBundle("/Images/About"); AboutTextView.Frame = new CGRect( AboutTextView.Frame.X, AboutTextView.Frame.Y, 320, 240); var Y = AboutTextView.Frame.Y + 240; StackOverflowButton.Frame = new CGRect(StackOverflowButton.Frame.X, Y, StackOverflowButton.Frame.Width, StackOverflowButton.Frame.Height); LinkedInButton.Frame = new CGRect(LinkedInButton.Frame.X, Y, LinkedInButton.Frame.Width, LinkedInButton.Frame.Height); TwitterButton.Frame = new CGRect(TwitterButton.Frame.X, Y, TwitterButton.Frame.Width, TwitterButton.Frame.Height); YouTubeButton.Frame = new CGRect(YouTubeButton.Frame.X, Y, YouTubeButton.Frame.Width, YouTubeButton.Frame.Height); FacebookButton.Frame = new CGRect(FacebookButton.Frame.X, Y, FacebookButton.Frame.Width, FacebookButton.Frame.Height); BlogRssButton.Frame = new CGRect(BlogRssButton.Frame.X, Y, BlogRssButton.Frame.Width, BlogRssButton.Frame.Height); } else { // IsPad ScrollView.Frame = new CGRect(0, 0, 768, 1004); ScrollView.ContentSize = new CGSize(768, 1024); XamLogoImageView.Image = UIImage.FromBundle("/Images/About-Portrait~iPad"); XamLogoImageView.Frame = ScrollView.Frame; CGSize size = UIStringDrawing.StringSize(AboutTextView.Text , AboutTextView.Font , new SizeF(738, 500) , UILineBreakMode.WordWrap); AboutTextView.Frame = new CGRect( 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."; }