Ejemplo n.º 1
0
        protected override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            // Note: the following block is not supported as in Silverlight,
            // we are not sure that the Loaded event will be raised after the
            // OnApplyTemplate method is called. This is moved to the constructor.
#if CSHTML5_NOT_SUPPORTED
            // Unhook registered events
            Loaded -= GridSplitter_Loaded;

            // Register Events
            Loaded += GridSplitter_Loaded;
#endif

            if (_hoverWrapper != null)
            {
                _hoverWrapper.UnhookEvents();
            }

#if CSHTML5_NOT_SUPPORTED
            ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
#else
            if (_thumb != null)
            {
                _thumb.DragDelta     -= Thumb_DragDelta;
                _thumb.DragStarted   -= Thumb_DragStarted;
                _thumb.DragCompleted -= Thumb_DragCompleted;
            }

            _thumb = this.GetTemplateChild("PART_Thumb") as Thumb;
            // Note: the thumb control is here only in CSHTML5. We use it to compensate for the lack of the "Manipulation" events.

            if (_thumb != null)
            {
                _thumb.DragDelta     += Thumb_DragDelta;
                _thumb.DragStarted   += Thumb_DragStarted;
                _thumb.DragCompleted += Thumb_DragCompleted;
            }
#endif
        }
Ejemplo n.º 2
0
        protected override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            // Unhook registered events
            Loaded -= GridSplitter_Loaded;

            // Register Events
            Loaded += GridSplitter_Loaded;

            if (_hoverWrapper != null)
            {
                _hoverWrapper.UnhookEvents();
            }

#if CSHTML5_NOT_SUPPORTED
            ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
#else
            _thumb = this.GetTemplateChild("PART_Thumb") as Thumb;
            // Note: the thumb control is here only in CSHTML5. We use it to compensate for the lack of the "Manipulation" events.
#endif
        }