Пример #1
0
        /// <summary>
        /// Initializing constructor
        /// </summary>
        /// <param name="parent">Reference to the parent window</param>
        /// <param name="parameters">Auto-hider configuration settings</param>
        public WindowAutoHider(Window parent, WindowAutoHiderParams parameters)
        {
            _parent       = parent;
            _mode         = AutoHideMode.None;
            _currentState = AutoHideState.Visible;
            _params       = parameters;

            _dropHelper = new DropHelper(parent);

            // This code may appear silly to an untrained eye, but if it's not here, even though 'parent.Left' has
            // a valid value, when we try animate it we might get an exception because DoubleAnimation might read it
            // as NaN. It's fine everywhere else, only the animation is screwed up.
            parent.Left = parent.Left;
            parent.Top  = parent.Top;
        }
Пример #2
0
        /// <summary>
        /// Initializing constructor
        /// </summary>
        /// <param name="parent">Reference to the parent window</param>
        /// <param name="parameters">Auto-hider configuration settings</param>
        public WindowAutoHider( Window parent, WindowAutoHiderParams parameters )
        {
            _parent = parent;
            _mode = AutoHideMode.None;
            _currentState = AutoHideState.Visible;
            _params = parameters;

            _dropHelper = new DropHelper( parent );

            // This code may appear silly to an untrained eye, but if it's not here, even though 'parent.Left' has
            // a valid value, when we try animate it we might get an exception because DoubleAnimation might read it
            // as NaN. It's fine everywhere else, only the animation is screwed up.
            parent.Left = parent.Left;
            parent.Top = parent.Top;
        }