/// <summary>
        /// Gets the <see cref="T:Size"/> uncovered by the SIP when it is shown.
        /// </summary>
        /// <param name="phoneApplicationFrame">The <see cref="T:PhoneApplicationFrame"/>.</param>
        /// <returns>The <see cref="T:Size"/>.</returns>
        public static Size GetSipUncoveredSize(this PhoneApplicationFrame phoneApplicationFrame)
        {
            double width  = phoneApplicationFrame.GetUsefulWidth();
            double height = phoneApplicationFrame.GetUsefulHeight() - phoneApplicationFrame.GetSipCoveredSize().Height;

            return(new Size(width, height));
        }
Beispiel #2
0
        public static double GetUsefullWidth()
        {
            PhoneApplicationFrame phoneAppFrame = null;

            if (TryGetPhoneApplicationFrame(out phoneAppFrame))
            {
                return(phoneAppFrame.GetUsefulWidth());
            }

            return(Application.Current.Host.Content.ActualWidth);
        }
        /// <summary>
        /// Gets the <see cref="T:Size"/> covered by the SIP when it is shown.
        /// </summary>
        /// <param name="phoneApplicationFrame">The <see cref="T:PhoneApplicationFrame"/>.</param>
        /// <returns>The <see cref="T:Size"/>.</returns>
        public static Size GetSipCoveredSize(this PhoneApplicationFrame phoneApplicationFrame)
        {
            if (!IsSipShown())
            {
                return(new Size(0, 0));
            }
            double  width  = phoneApplicationFrame.GetUsefulWidth();
            double  height = phoneApplicationFrame.IsPortrait() ? SipPortraitHeight : SipLandscapeHeight;
            TextBox textBox;

            if (TryGetFocusedTextBox(out textBox) && textBox.IsSipTextCompletionShown())
            {
                height += SipTextCompletionHeight;
            }
            return(new Size(width, height));
        }
 /// <summary>
 /// Gets the correct <see cref="T:Size"/> of a <see cref="T:PhoneApplicationFrame"/>.
 /// </summary>
 /// <param name="phoneApplicationFrame">The <see cref="T:PhoneApplicationFrame"/>.</param>
 /// <returns>The <see cref="T:Size"/>.</returns>
 public static Size GetUsefulSize(this PhoneApplicationFrame phoneApplicationFrame)
 {
     return(new Size(phoneApplicationFrame.GetUsefulWidth(), phoneApplicationFrame.GetUsefulHeight()));
 }