ColumnDefinition
ColumnDefinition
ColumnDefinition
ColumnDefinition
Class
Definition
public : sealed class ColumnDefinition : DependencyObject
struct winrt::Windows::UI::Xaml::Controls::ColumnDefinition : DependencyObject
public sealed class ColumnDefinition : DependencyObject
Public NotInheritable Class ColumnDefinition Inherits DependencyObject
<ColumnDefinition .../>
- Inheritance
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced v10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Examples
The following example uses three ColumnDefinitionand three RowDefinition s to create a grid that has nine cells, such as in a worksheet. Each cell contains a TextBlock element that represents data, and the top row contains a TextBlock with the ColumnSpan property applied.
<Grid VerticalAlignment="Top" HorizontalAlignment="Left"
Width="350" Height="200">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="20" FontWeight="Bold"
Grid.ColumnSpan="3" Grid.Row="0">Expenses for 2007</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="15" FontWeight="Bold"
Grid.Row="1" Grid.Column="0">Travel</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="15" FontWeight="Bold"
Grid.Row="1" Grid.Column="1">Office Supplies</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="15" FontWeight="Bold"
Grid.Row="1" Grid.Column="2">Salary</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Grid.Row="2" Grid.Column="0">20000</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Grid.Row="2" Grid.Column="1">10000</TextBlock>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Grid.Row="2" Grid.Column="2">50000</TextBlock>
<TextBlock FontSize="16" FontWeight="Bold"
Grid.ColumnSpan="3" Grid.Row="3">Total Expense: 80000</TextBlock>
</Grid>
Constructors
ColumnDefinition() ColumnDefinition() ColumnDefinition() ColumnDefinition() |
Initializes a new instance of the ColumnDefinition class. |
Properties
ActualWidth ActualWidth ActualWidth ActualWidth |
Gets a value that represents the actual calculated width of a ColumnDefinition. |
Dispatcher Dispatcher Dispatcher Dispatcher |
Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. (Inherited from DependencyObject) |
MaxWidth MaxWidth MaxWidth MaxWidth |
Gets or sets a value that represents the maximum width of a ColumnDefinition. |
MaxWidthProperty MaxWidthProperty MaxWidthProperty MaxWidthProperty |
Identifies the MaxWidth dependency property. |
MinWidth MinWidth MinWidth MinWidth |
Gets or sets a value that represents the minimum width of a ColumnDefinition. |
MinWidthProperty MinWidthProperty MinWidthProperty MinWidthProperty |
Identifies the MinWidth dependency property. |
Width Width Width Width |
Gets the calculated width of a ColumnDefinition element, or sets the GridLength value of a column that is defined by the ColumnDefinition. |
WidthProperty WidthProperty WidthProperty WidthProperty |
Identifies the Width dependency property. |
Methods
See also
Feedback
Loading feedback...