Beispiel #1
0
        private void UpdateImageViewerDecoratorPosition()
        {
            if (!(this.Content is Grid) || this._imageViewerDecorator == null)
            {
                return;
            }
            Grid grid = this.Content as Grid;

            if (grid.Margin.Top > 0.0)
            {
                this._imageViewerDecorator.RenderTransform = (Transform) new CompositeTransform()
                {
                    TranslateY = -grid.Margin.Top
                };
            }
            else
            {
                Thickness margin = grid.Margin;
                if (margin.Left <= 0.0)
                {
                    return;
                }
                ImageViewerDecoratorUC viewerDecoratorUc  = this._imageViewerDecorator;
                CompositeTransform     compositeTransform = new CompositeTransform();
                margin = grid.Margin;
                double num = -margin.Left;
                compositeTransform.TranslateX     = num;
                viewerDecoratorUc.RenderTransform = (Transform)compositeTransform;
            }
        }
Beispiel #2
0
        private void UpdateImageViewerDecoratorPosition()
        {
            if (!(((UserControl)this).Content is Grid) || this._imageViewerDecorator == null)
            {
                return;
            }
            Grid      content = ((UserControl)this).Content as Grid;
            Thickness margin1 = ((FrameworkElement)content).Margin;

            // ISSUE: explicit reference operation
            if (((Thickness)@margin1).Top > 0.0)
            {
                ImageViewerDecoratorUC imageViewerDecorator = this._imageViewerDecorator;
                CompositeTransform     compositeTransform   = new CompositeTransform();
                Thickness margin2 = ((FrameworkElement)content).Margin;
                // ISSUE: explicit reference operation
                double num = -((Thickness)@margin2).Top;
                compositeTransform.TranslateY = num;
                ((UIElement)imageViewerDecorator).RenderTransform = ((Transform)compositeTransform);
            }
            else
            {
                Thickness margin2 = ((FrameworkElement)content).Margin;
                // ISSUE: explicit reference operation
                if (((Thickness)@margin2).Left <= 0.0)
                {
                    return;
                }
                ImageViewerDecoratorUC imageViewerDecorator = this._imageViewerDecorator;
                CompositeTransform     compositeTransform   = new CompositeTransform();
                margin2 = ((FrameworkElement)content).Margin;
                // ISSUE: explicit reference operation
                double num = -((Thickness)@margin2).Left;
                compositeTransform.TranslateX = num;
                ((UIElement)imageViewerDecorator).RenderTransform = ((Transform)compositeTransform);
            }
        }