Exemplo n.º 1
0
        /// <summary>
        /// Shows the panel maximized in the host.
        /// </summary>
        /// <param name="transition">The transition to perform while the panel is shown.</param>
        public virtual void ShowMaximized(ShowTransition transition)
        {
            Visible = false;
            FluidHost host = FluidHost.Instance;

            host.Add(this);
            Bounds = host.ClientBounds;
            Show(transition);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the panel with the specified transition.
        /// </summary>
        /// <param name="transition">The transition to perform while the panel is shown.</param>
        public virtual void Show(ShowTransition transition)
        {
            previousFocusedControl          = Host != null ? Host.FocusedControl : null;
            showTransition                  = transition;
            FluidTextBox.InputPanel.Enabled = false;
            Visible = false;
            FluidHost host   = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int       h      = client.Height;
            int       w      = client.Width;

            host.Add(this);
            bool modal = false;

            Bounds  = GetShowStartBounds(transition);
            Visible = true;

            switch (transition)
            {
            case ShowTransition.None:
                Show();
                break;

            case ShowTransition.FromBottom:
                AnimateTop(h - Bounds.Height, Animation.DefaultDuration, modal);
                break;

            case ShowTransition.FromTop:
                AnimateTop(Bounds.Height, Animation.DefaultDuration, modal);
                break;

            default:
                throw new NotImplementedException();
            }
            Focus();
            OnShowing();
        }