Exemplo n.º 1
1
        protected override FrameworkElement ModifyNewContent(ITransitionControl container, FrameworkElement newContent)
        {
            if (newContent == null)
            {
                HideBackground(container);
                container.Remove(_border);
                return null;
            }

            ShowBackground(container);

            _border = WrapInBorder(newContent);

            _border.Opacity = 0;

            SetPosition(_border);

            newContent.SizeChanged += (sender, e) => SetPosition(_border);

            var ctrl = container.AsControl();

            ctrl.SizeChanged += (sender, e) => SetPosition(_border);

            return _border;
        }
        protected override FrameworkElement ModifyNewContent(ITransitionControl container, FrameworkElement newContent)
        {
            var ctrl = container.AsControl();

            _leftStart = GetLeftStart(ctrl);
            _width = ctrl.ActualWidth;

            Canvas.SetLeft(newContent, _leftStart - _width);
            return newContent;
        }