Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
[TypeConverterAttribute(typeof(GridLengthConverter))] public value class GridLength : IEquatable<GridLength>
/** @attribute TypeConverterAttribute(System.Windows.GridLengthConverter) */ public final class GridLength extends ValueType implements IEquatable<GridLength>
doubleLength The element’s length, described as either a Double value that specifies a measure, or as a qualifiedDouble (see below). autoValue The element's length, described by either the value Auto or *. See GridUnitType for more information on the values Auto and *. qualifiedDouble A double value as described above for any of the measures, followed by one of the following unit declaration strings: px, in, cm, pt. px (default) is device-independent units (1/96th inch per unit) in is inches; 1in==96px cm is centimeters; 1cm==(96/2.54) px pt is points; 1pt==(96/72) px
The following example shows how to create and use an instance of GridLengthConverter. The example defines a custom method called changeCol, which passes the ListBoxItem to a GridLengthConverter that converts the Content of a ListBoxItem to an instance of GridLength. The converted value is then passed back as the value of the Width property of the ColumnDefinition element.
The example also defines a second custom method, called changeColVal. This custom method converts the Value of a Slider to a String and then passes that value back to the ColumnDefinition as the Width of the element.
Note that a separate Extensible Application Markup Language (XAML) file defines the contents of a ListBoxItem.
To view the complete sample, including the related XAML file, see Instantiating and Using a GridLengthConverter Object Sample.
|How to: Build a Standard UI Dialog Box by Using Grid|| |
This example shows how to create a standard user interface (UI) dialog box by using the Grid element.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.