Ejemplo n.º 1
0
		public void ChangingGridPropertiesInvalidates ()
		{
			// Normally remeasuring with the same width/height does not result in MeasureOverride
			// being called, but if we change a grid property, it does.
			MyGrid g = new MyGrid ();
			g.AddRows (GridLength.Auto, GridLength.Auto, GridLength.Auto);
			g.AddColumns (GridLength.Auto, GridLength.Auto, GridLength.Auto);
			g.AddChild (ContentControlWithChild (), 0, 0, 1, 1);

			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#1", new Size (inf, inf));

			g.Reset ();
			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#2");

			g.ChangeRowSpan (0, 2);
			g.Reset ();
			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#3", new Size (inf, inf));

			g.ChangeColSpan (0, 2);
			g.Reset ();
			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#4", new Size (inf, inf));

			g.ChangeRow (0, 1);
			g.Reset ();
			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#5", new Size (inf, inf));

			g.ChangeCol (0, 1);
			g.Reset ();
			g.Measure (new Size (50, 50));
			g.CheckMeasureArgs ("#6", new Size (inf, inf));
		}