GroupStyle 클래스

정의

GroupItems의 컬렉션과 같이 컬렉션에 그룹화된 항목을 표시하는 방법을 설명합니다.

/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GroupStyle : INotifyPropertyChanged
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class GroupStyle : INotifyPropertyChanged
Public Class GroupStyle
Implements INotifyPropertyChanged
<GroupStyle />
상속
Object IInspectable GroupStyle
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

여기서 GroupStyle은 그룹화된 데이터를 포함하는 GridView 컨트롤에 적용됩니다. 자세한 내용을 확인하고 전체 예제 코드를 보려면 목록 또는 그리드에서 항목을 그룹화하는 방법을 참조하세요.

<GridView ItemsSource="{Binding Source={StaticResource cvsProjects}}" 
  Margin="0,120,0,0" MaxHeight="500" Grid.Column="1">
    <GridView.ItemTemplate>
        <DataTemplate>
            <StackPanel Margin="20">
                <TextBlock Text="{Binding Name}" FontWeight="Bold" 
                           Style="{StaticResource BaseTextBlockStyle}"/>
                <TextBlock Text="{Binding DueDate}" TextWrapping="NoWrap" 
                           Style="{StaticResource BodyTextBlockStyle}" />
                <CheckBox Content="Complete" IsChecked="{Binding Complete}" 
                          IsEnabled="False"/>
            </StackPanel>
        </DataTemplate>
    </GridView.ItemTemplate>
    <GridView.ItemsPanel>
        <ItemsPanelTemplate>
            <ItemsWrapGrid MaximumRowsOrColumns="3"/>
        </ItemsPanelTemplate>
    </GridView.ItemsPanel>

    <GridView.GroupStyle>
        <GroupStyle HidesIfEmpty="True">
            <GroupStyle.HeaderTemplate>
                <DataTemplate>
                    <Grid Background="LightGray" Margin="0">
                        <TextBlock Text='{Binding Name}' 
                                   Foreground="Black" Margin="30"
                                   Style="{StaticResource HeaderTextBlockStyle}"/>
                    </Grid>
                </DataTemplate>
            </GroupStyle.HeaderTemplate>

        </GroupStyle>
    </GridView.GroupStyle>
</GridView>

설명

GroupStyle은 일반적으로 XAML(Extensible Application Markup Language)에서 정의한 다음 ItemsControl.GroupStyle 속성의 값으로 설정하여 그룹의 시각적 모양을 정의합니다.

생성자

GroupStyle()

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

속성

ContainerStyle

참고

ContainerStyle은 Windows 8.1 후 릴리스에 대해 변경되거나 사용할 수 없으며 ItemsControl.GroupStyle에는 지원되지 않습니다.

각 항목에 대해 생성된 GroupItem 에 적용되는 스타일을 가져오거나 설정합니다.

ContainerStyleSelector

참고

ContainerStyleSelector는 Windows 8.1 후 릴리스에서 변경되거나 사용할 수 없으며 ItemsControl.GroupStyle에는 지원되지 않습니다.

사용자 지정 StyleSelector 논리 클래스에 대한 참조를 가져오거나 설정합니다. 이 속성에서 참조하는 StyleSelector 는 생성된 각 GroupItem에 적용할 스타일을 반환합니다.

HeaderContainerStyle

각 항목의 헤더에 적용되는 스타일을 가져오거나 설정합니다.

HeaderTemplate

그룹 머리글을 표시하는 데 사용되는 템플릿을 가져오거나 설정합니다.

HeaderTemplateSelector

사용자 지정 DataTemplateSelector 논리 클래스에 대한 참조를 가져오거나 설정합니다. DataTemplateSelector는 그룹 항목 콘텐츠의 헤더 영역에 사용할 다양한 DataTemplate 값을 반환합니다.

HidesIfEmpty

빈 그룹에 해당하는 항목을 표시해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

Panel

항목을 배치하는 데 사용되는 패널을 만드는 템플릿을 가져오거나 설정합니다.

이벤트

PropertyChanged

속성 값이 변경될 때 발생합니다.

적용 대상

추가 정보