Пример #1
0
        public void Out_Of_Bounds_Control_Should_Not_Be_Rendered()
        {
            TestControl target;
            var container = new Canvas
            {
                Width = 100,
                Height = 100,
                ClipToBounds = true,
                Children = new Controls.Controls
                {
                    (target = new TestControl
                    {
                        Width = 10,
                        Height = 10,
                        ClipToBounds = true,
                        [Canvas.LeftProperty] = 110,
                        [Canvas.TopProperty] = 110,
                    })
                }
            };

            Render(container);

            Assert.False(target.Rendered);
        }
Пример #2
0
        public void Negative_Margin_Should_Be_Respected()
        {
            TestControl target;
            var container = new Canvas
            {
                Width = 100,
                Height = 100,
                ClipToBounds = true,
                Children = new Controls.Controls
                {
                    new Border
                    {
                        Margin = new Thickness(100, 100, 0, 0),
                        Child = target = new TestControl
                        {
                            Width = 10,
                            Height = 10,
                            Margin = new Thickness(-100, -100, 0, 0),
                        }
                    }
                }
            };

            Render(container);

            Assert.True(target.Rendered);
        }
Пример #3
0
        public void RenderTransform_Should_Be_Respected()
        {
            TestControl target;
            var container = new Canvas
            {
                Width = 100,
                Height = 100,
                ClipToBounds = true,
                Children = new Controls.Controls
                {
                    (target = new TestControl
                    {
                        Width = 10,
                        Height = 10,
                        [Canvas.LeftProperty] = 110,
                        [Canvas.TopProperty] = 110,
                        RenderTransform = new TranslateTransform(-100, -100),
                    })
                }
            };

            Render(container);

            Assert.True(target.Rendered);
        }