Ejemplo n.º 1
0
		public ColumnHeader (string text, GridLength width ) : base ( width )
		{
			if (width.IsAuto)
				throw new NotImplementedException ("Auto");

			this.TextAlignment 	= TextAlignment.Left;
			this.Text 			= text;
			this.TextColor 		= Color.White;
		}
Ejemplo n.º 2
0
 /// <summary>
 /// Set the height/width of the given row/column 
 /// </summary> 
 private static void SetDefinitionLength(DefinitionAbstraction definition, GridLength length)
 { 
     if (definition.AsColumnDefinition != null)
     {
         definition.AsColumnDefinition.SetValue(ColumnDefinition.WidthProperty, length); 
     }
     else
     { 
         definition.AsRowDefinition.SetValue(RowDefinition.HeightProperty, length); 
     }
 } 
Ejemplo n.º 3
0
        // optimized measure for common usage
        private Size MeasureSingleCell(Size availableSize, GridLength width, GridLength height)
        {
            Size desiredSize = Size.Zero;
            availableSize = new Size(width.IsAbsolute ? width.Value : availableSize.Width, height.IsAbsolute ? height.Value : availableSize.Height);

            foreach (FrameworkElement child in Children)
            {
                child.Measure(availableSize);
                desiredSize = desiredSize.Max(child.DesiredSize);
            }

            return desiredSize;
        }
Ejemplo n.º 4
0
        // optimized arrange for common usage
        private Size ArrangeSingleCell(Size finalSize, GridLength width, GridLength height)
        {
            double finalWidth = width.IsAbsolute ? width.Value : finalSize.Width;
            double finalHeight = height.IsAbsolute ? height.Value : finalSize.Height;

            Rect finalRect = new Rect(finalWidth, finalHeight);

            foreach (FrameworkElement child in Children)
            {
                child.Arrange(finalRect);
            }

            return finalSize;
        }
Ejemplo n.º 5
0
		public ColumnDefinition (GridLength width) : this ( width, null, null )
		{
		}
Ejemplo n.º 6
0
		public ColumnDefinition (GridLength width, float? minWidth, float? maxWidth)
		{
			this.Width = width;
			this.MinWidth = minWidth;
			this.MaxWidth = maxWidth;
		}