Пример #1
0
        public void BindToValidGridSplitter()
        {
            Grid         g        = GridSplitterTest.CreateGrid(2, 2, 100, 100);
            GridSplitter splitter = GridSplitterTest.CreateGridSplitterThroughCode(1, 1, 1, null, null, 10.0, null, HorizontalAlignment.Left, new SolidColorBrush(Colors.Cyan), true);

            g.Children.Add(splitter);
            PreviewControl preview = new PreviewControl();

            this.CreateAsyncTest(g,
                                 () => preview.Bind(splitter),
                                 delegate
            {
                Assert.AreEqual(50.0, preview.Height, "Height should be half the height of the grid");
                Assert.AreEqual(10.0, preview.Width, "Width should be the width of the GridSplitter");
                Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.LeftProperty), "Left position should be on left edge of the second column");
                Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.TopProperty), "Top position should be on top edge of the second row");
            });
        }
Пример #2
0
 public void BindToValidGridSplitter()
 {
     Grid g = GridSplitterTest.CreateGrid(2, 2, 100, 100);
     GridSplitter splitter = GridSplitterTest.CreateGridSplitterThroughCode(1, 1, 1, null, null, 10.0, null, HorizontalAlignment.Left, new SolidColorBrush(Colors.Cyan), true);
     g.Children.Add(splitter);
     PreviewControl preview = new PreviewControl();
     this.CreateAsyncTest(g,
         () => preview.Bind(splitter),
         delegate
         {
             Assert.AreEqual(50.0, preview.Height, "Height should be half the height of the grid");
             Assert.AreEqual(10.0, preview.Width, "Width should be the width of the GridSplitter");
             Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.LeftProperty), "Left position should be on left edge of the second column");
             Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.TopProperty), "Top position should be on top edge of the second row");
         });
 }