コード例 #1
0
 private void OnSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (e != null)
     {
         System.Windows.Size newSize = e.NewSize;
         double num          = newSize.Width > newSize.Height ? newSize.Width : newSize.Height;
         double actualWidth  = Application.Current.Host.Content.ActualWidth;
         double actualHeight = Application.Current.Host.Content.ActualHeight;
         this._softNavButtonsCurrentWidth = Math.Max((actualWidth > actualHeight ? actualWidth : actualHeight) - num, 0.0);
     }
     this.InitializeOrientation(TextBoxPanelControl.GetScreenOrientation());
 }
コード例 #2
0
        private void InputPane_OnShowing(InputPane sender, InputPaneVisibilityEventArgs args)
        {
            Windows.Foundation.Rect occludedRect = args.OccludedRect;
            double      width             = occludedRect.Width;
            double      height            = occludedRect.Height;
            double      num1              = this._pageWidth;
            Orientation screenOrientation = TextBoxPanelControl.GetScreenOrientation();

            if (screenOrientation == Orientation.Horizontal)
            {
                num1 -= this._softNavButtonsCurrentWidth;
            }
            double num2 = num1 / width;
            double num3 = width * num2;
            double d    = height * num2;

            if (double.IsNaN(d) || double.IsInfinity(d) || (d == 0.0 || this._isTextBoxHiding))
            {
                this._isTextBoxHiding = false;
            }
            else
            {
                if (screenOrientation != Orientation.Vertical)
                {
                    if (screenOrientation == Orientation.Horizontal)
                    {
                        KeyboardHelper.LandscapeHeight = d;
                    }
                }
                else
                {
                    KeyboardHelper.PortraitHeight = d;
                }
                this.InitializeOrientation(screenOrientation);
            }
        }