/// <summary>
        /// Initializes a new instance of the
        /// <see cref="T:System.Windows.Controls.GridSplitter" /> class.
        /// </summary>
        public GridSplitter()
        {
            this.IsEnabledChanged             += new DependencyPropertyChangedEventHandler(OnIsEnabledChanged);
            this.KeyDown                      += new KeyEventHandler(GridSplitter_KeyDown);
            this.LayoutUpdated                += delegate { UpdateTemplateOrientation(); };
            _dragValidator                     = new DragValidator(this);
            _dragValidator.DragStartedEvent   += new EventHandler <DragStartedEventArgs>(DragValidator_DragStartedEvent);
            _dragValidator.DragDeltaEvent     += new EventHandler <DragDeltaEventArgs>(DragValidator_DragDeltaEvent);
            _dragValidator.DragCompletedEvent += new EventHandler <DragCompletedEventArgs>(DragValidator_DragCompletedEvent);

            this.MouseEnter += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = true;
                ChangeVisualState();
            };

            this.MouseLeave += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = false;

                // Only change the visual state if we're not currently resizing,
                // the visual state will get updated when the resize operation
                // comples
                if (ResizeDataInternal == null)
                {
                    ChangeVisualState();
                }
            };

            this.GotFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };

            this.LostFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };

            DefaultStyleKey = typeof(GridSplitter);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GridSplitter"/> class
        /// </summary>
        public GridSplitter()
        {
            this.KeyDown  += new KeyEventHandler(GridSplitter_KeyDown);
            this.IsTabStop = true;
            this.IsEnabled = true;

            _dragValidator = new DragValidator(this);
            _dragValidator.DragStartedEvent   += new EventHandler <DragStartedEventArgs>(DragValidator_DragStartedEvent);
            _dragValidator.DragDeltaEvent     += new EventHandler <DragDeltaEventArgs>(DragValidator_DragDeltaEvent);
            _dragValidator.DragCompletedEvent += new EventHandler <DragCompletedEventArgs>(DragValidator_DragCompletedEvent);

            this.MouseEnter += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = true;
                ChangeVisualState();
            };

            this.MouseLeave += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = false;
                // Only change the visual state if we're not currently resizing, the visual state will get updated when the resize operation completes
                if (_resizeData == null)
                {
                    ChangeVisualState();
                }
            };

            this.GotFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };

            this.LostFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };
        }
Exemple #3
0
        /// <summary> 
        /// Initializes a new instance of the <see cref="GridSplitter"/> class
        /// </summary>
        public GridSplitter() 
        {
            this.KeyDown += new KeyEventHandler(GridSplitter_KeyDown);
            this.IsTabStop = true; 
            this.IsEnabled = true; 

            _dragValidator = new DragValidator(this); 
            _dragValidator.DragStartedEvent += new EventHandler<DragStartedEventArgs>(DragValidator_DragStartedEvent);
            _dragValidator.DragDeltaEvent += new EventHandler<DragDeltaEventArgs>(DragValidator_DragDeltaEvent);
            _dragValidator.DragCompletedEvent += new EventHandler<DragCompletedEventArgs>(DragValidator_DragCompletedEvent); 

            this.MouseEnter += delegate(object sender, MouseEventArgs e)
            { 
                _isMouseOver = true; 
                ChangeVisualState();
            }; 

            this.MouseLeave += delegate(object sender, MouseEventArgs e)
            { 
                _isMouseOver = false;
                // Only change the visual state if we're not currently resizing, the visual state will get updated when the resize operation completes
                if (_resizeData == null) 
                { 
                    ChangeVisualState();
                } 
            };

            this.GotFocus += delegate(object sender, RoutedEventArgs e) 
            {
                ChangeVisualState();
            }; 
 
            this.LostFocus += delegate(object sender, RoutedEventArgs e)
            { 
                ChangeVisualState();
            };
        } 
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="T:System.Windows.Controls.GridSplitter" /> class.
        /// </summary>
        public GridSplitter()
        {
            this.IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnIsEnabledChanged);
            this.KeyDown += new KeyEventHandler(GridSplitter_KeyDown);
            this.LayoutUpdated += delegate { UpdateTemplateOrientation(); };
            _dragValidator = new DragValidator(this);
            _dragValidator.DragStartedEvent += new EventHandler<DragStartedEventArgs>(DragValidator_DragStartedEvent);
            _dragValidator.DragDeltaEvent += new EventHandler<DragDeltaEventArgs>(DragValidator_DragDeltaEvent);
            _dragValidator.DragCompletedEvent += new EventHandler<DragCompletedEventArgs>(DragValidator_DragCompletedEvent);

            this.MouseEnter += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = true;
                ChangeVisualState();
            };

            this.MouseLeave += delegate(object sender, MouseEventArgs e)
            {
                _isMouseOver = false;

                // Only change the visual state if we're not currently resizing,
                // the visual state will get updated when the resize operation
                // comples
                if (ResizeDataInternal == null)
                {
                    ChangeVisualState();
                }
            };

            this.GotFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };

            this.LostFocus += delegate(object sender, RoutedEventArgs e)
            {
                ChangeVisualState();
            };

            DefaultStyleKey = typeof(GridSplitter);
        }