Пример #1
0
        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);
        }
Пример #2
0
        /// <summary>
        /// Desc : Update Status
        /// </summary>
        /// <param name="status"></param>
        public bool AddWhatIsInYourMind(string status)
        {
            try
            {
                Utils.driver.FindElement(By.LinkText("Home")).Click();
                StatusInput.DoClick();
                StatusInput.SendChar(status);

                if (EmojiButton.Displayed)
                {
                    EmojiButton.Click();
                }

                EmojiType.Click();
                StatusInput.Click();
                PostButton.Click();
                System.Threading.Thread.Sleep(3000);
                if (Utils.driver.FindElements(By.XPath("//p[contains(text(),'" + status + "')]")).Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (PostButton != null)
            {
                PostButton.Dispose();
                PostButton = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
Пример #4
0
        void ReleaseDesignerOutlets()
        {
            if (Screenshot != null)
            {
                Screenshot.Dispose();
                Screenshot = null;
            }

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

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

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

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

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

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

            if (NextBtn != null)
            {
                NextBtn.Dispose();
                NextBtn = null;
            }
        }
Пример #5
0
        /// <summary>
        /// Desc : Update Status
        /// </summary>
        /// <param name="status"></param>
        public bool AddWhatIsInYourMind(string status)
        {
            try
            {
                Utils.driver.FindElement(By.LinkText("Home")).Click();

                var textArea = Utils.driver.FindElements(By.XPath("//textarea[contains(@title,'Write something here')]"));
                if (textArea.Count > 0)
                {
                    textArea[0].Click();
                }
                else
                {
                    StatusInput.DoClick();
                }

                StatusInput.SendChar(status);

                if (EmojiButton.Displayed)
                {
                    EmojiButton.Click();
                }

                EmojiType.Click();
                StatusInput.Click();
                PostButton.Click();
                System.Threading.Thread.Sleep(3000);
                if (Utils.driver.FindElements(By.XPath("//p[contains(text(),'" + status + "')]")).Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
                return(false);
            }
        }
 public void ClickPostUploadButton()
 {
     PostButton.Click();
 }
Пример #7
0
        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;
            }
        }