Exemplo n.º 1
0
        public static bool IsPortrait()
        {
            PhoneApplicationFrame phoneAppFrame = null;

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

            return(true);
        }
Exemplo n.º 2
0
        /// <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));
        }
Exemplo n.º 3
0
 public static double GetUsefulWidth(this PhoneApplicationFrame phoneApplicationFrame)
 {
     return(phoneApplicationFrame.IsPortrait() ? phoneApplicationFrame.ActualWidth : phoneApplicationFrame.ActualHeight);
 }