Share via


ColumnDefinition 클래스

정의

Grid 개체에 적용되는 열별 속성을 정의합니다.

public ref class ColumnDefinition sealed : DependencyObject
/// [Microsoft.UI.Xaml.Markup.ContentProperty(Name="Width")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ColumnDefinition final : DependencyObject
[Microsoft.UI.Xaml.Markup.ContentProperty(Name="Width")]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ColumnDefinition : DependencyObject
Public NotInheritable Class ColumnDefinition
Inherits DependencyObject
<ColumnDefinition .../>
상속
Object Platform::Object IInspectable DependencyObject ColumnDefinition
특성

예제

다음 예제에서는 ColumnDefinition 3개와 RowDefinition3개를 사용하여 워크시트와 같이 9개의 셀이 있는 그리드를 만듭니다. 각 셀에는 데이터를 나타내는 TextBlock 요소가 포함되고 위쪽 행에는 ColumnSpan 속성이 적용된 TextBlock이 포함됩니다.

<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>

생성자

ColumnDefinition()

ColumnDefinition 클래스의 새 instance 초기화합니다.

속성

ActualWidth

ColumnDefinition의 실제 계산 너비를 나타내는 값을 가져옵니다.

Dispatcher

항상 Windows 앱 SDK 앱에서 를 반환 null 합니다. 대신 DispatcherQueue 를 사용합니다.

(다음에서 상속됨 DependencyObject)
DispatcherQueue

DispatcherQueue 이 개체가 연결된 을 가져옵니다. 는 DispatcherQueue 코드가 비 UI 스레드에 의해 시작되는 경우에도 UI 스레드에서 에 액세스할 DependencyObject 수 있는 기능을 나타냅니다.

(다음에서 상속됨 DependencyObject)
MaxWidth

ColumnDefinition의 최대 너비를 나타내는 값을 가져오거나 설정합니다.

MaxWidthProperty

MaxWidth 종속성 속성을 식별합니다.

MinWidth

ColumnDefinition의 최소 너비를 나타내는 값을 가져오거나 설정합니다.

MinWidthProperty

MinWidth 종속성 속성을 식별합니다.

Width

ColumnDefinition 요소의 계산된 너비를 가져오거나 ColumnDefinition으로 정의된 열의 GridLength 값을 설정합니다. ColumnDefinition의 콘텐츠 속성 입니다.

WidthProperty

Width 종속성 속성을 식별합니다.

메서드

ClearValue(DependencyProperty)

종속성 속성의 로컬 값을 지웁니다.

(다음에서 상속됨 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

애니메이션이 활성화되지 않은 경우 적용되는 종속성 속성에 대해 설정된 모든 기본 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
GetValue(DependencyProperty)

DependencyObject에서 종속성 속성의 현재 유효 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
ReadLocalValue(DependencyProperty)

로컬 값이 설정된 경우 종속성 속성의 로컬 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

DependencyObject instance 특정 DependencyProperty의 변경 내용을 수신 대기하기 위한 알림 함수를 등록합니다.

(다음에서 상속됨 DependencyObject)
SetValue(DependencyProperty, Object)

DependencyObject에서 종속성 속성의 로컬 값을 설정합니다.

(다음에서 상속됨 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

RegisterPropertyChangedCallback을 호출하여 이전에 등록된 변경 알림을 취소합니다.

(다음에서 상속됨 DependencyObject)

적용 대상

추가 정보