CornerRadiusFilterConverter 클래스

정의

기존 CornerRadius 구조체를 새 CornerRadius 구조체로 변환하고 필터를 적용하여 지정된 필드만 추출하고 나머지는 0으로 설정합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

public ref class CornerRadiusFilterConverter sealed : DependencyObject, IValueConverter
/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
/// [Windows.Foundation.Metadata.Activatable(1)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class CornerRadiusFilterConverter final : DependencyObject, IValueConverter
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.XamlContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
class CornerRadiusFilterConverter final : DependencyObject, IValueConverter
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
[Windows.Foundation.Metadata.Activatable(1)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public sealed class CornerRadiusFilterConverter : DependencyObject, IValueConverter
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.XamlContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public sealed class CornerRadiusFilterConverter : DependencyObject, IValueConverter
Public NotInheritable Class CornerRadiusFilterConverter
Inherits DependencyObject
Implements IValueConverter
상속
CornerRadiusFilterConverter
특성
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute ActivatableAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
구현

예제

WinUI 기능 및 컨트롤의 예는 XAML 컨트롤 갤러리 샘플 앱을 참조하세요.

XAML 컨트롤 갤러리 앱이 설치된 경우 앱을 열어 작동 중인 컨트롤을 확인합니다.

XAML 컨트롤 갤러리 앱이 설치되어 있지 않은 경우 Microsoft Store에서 WinUI 2.x 버전을 가져옵니다.

GitHub에서 XAML 컨트롤 갤러리 소스 코드를 보고, 복제하고, 빌드할 수도 있습니다(WinUI 3 미리 보기 컨트롤 및 기능에 대한 WinUI 3 미리 보기 분기로 전환).

다음 예제에서는 CornerRadiusFilterConverter 요소를 사용하는 방법을 보여줍니다.

<ControlTemplate TargetType="Button">
    <Grid>
        <Grid.Resources>
            <CornerRadiusFilterConverter Filter="Top" x:Name="TopCornersFilter" />
        </Grid.Resources>
        <Border Background="{TemplateBinding Background}"
                CornerRadius="{Binding  CornerRadius,
                RelativeSource={RelativeSource TemplatedParent},
                Converter={StaticResource TopCornersFilter}}"
                Padding="{TemplateBinding Padding}">
            <ContentPresenter />
        </Border>
    </Grid>
</ControlTemplate>

설명

Binding 또는 TemplateBinding과 함께 CornerRadiusFilterConverter를 사용하여 기존 구조체에서 새 CornerRadius 구조체를 만들고 일부 필드만 추출하고 나머지는 0으로 설정합니다.

생성자

CornerRadiusFilterConverter()

CornerRadiusFilterConverter 클래스의 새 인스턴스를 초기화합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

속성

Filter

CornerRadiusFilterConverter에 적용되는 필터의 형식을 가져오거나 설정합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

FilterProperty

필터 종속성 속성을 식별합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

Scale

CornerRadiusFilterConverter에 적용되는 배율 승수를 가져오거나 설정합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

ScaleProperty

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

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

메서드

Convert(Object, TypeName, Object, String)

필터에 지정된 필드만 추출하고 다른 필드를 0으로 설정하여 원본 CornerRadius를 변환합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

ConvertBack(Object, TypeName, Object, String)

구현되지 않았습니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

적용 대상

추가 정보