UIElement 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
UIElement는 시각적 모양이 있고 앱의 사용자 인터페이스의 일부로 기본 입력을 처리할 수 있는 대부분의 Windows 런타임 UI 개체에 대한 기본 클래스입니다.
UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.UIElement(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).
public ref class UIElement : DependencyObject
public ref class UIElement : DependencyObject, IAnimationObject
public ref class UIElement : DependencyObject, IAnimationObject, IVisualElement
/// [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 UIElement : DependencyObject
/// [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 UIElement : DependencyObject, IAnimationObject
/// [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 UIElement : DependencyObject, IAnimationObject, IVisualElement
[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 UIElement : DependencyObject
[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 UIElement : DependencyObject, IAnimationObject
[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 UIElement : DependencyObject, IAnimationObject, IVisualElement
Public Class UIElement
Inherits DependencyObject
Public Class UIElement
Inherits DependencyObject
Implements IAnimationObject
Public Class UIElement
Inherits DependencyObject
Implements IAnimationObject, IVisualElement
- 상속
- 파생
- 특성
- 구현
Windows 요구 사항
| 디바이스 패밀리 |
Windows 10 (10.0.10240.0에서 도입되었습니다.)
|
| API contract |
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)
|
설명
UIElement는 기본 요소입니다. XAML UI 요소 모델을 지원하기 위해 다른 많은 Windows 런타임 클래스가 상속하는 클래스입니다. UIElement에서 정의하는 속성, 메서드 및 이벤트는 수백 개의 다른 Windows 런타임 클래스에서 상속됩니다.
UIElement는 포커스 보고(GotFocus, LostFocus)에 대한 이벤트를 정의하지만 UIElement는 프로그래밍 방식으로 포커스를 설정하기 위한 API를 정의하지 않습니다. 이 기능은 클래스에 의해 정의됩니다 Control .
UIElement는 공용 생성자를 노출하지 않습니다. 일반적으로 UIElement 또는 FrameworkElement 직접 클래스를 파생하지 않습니다. 파생 사용자 지정 클래스에 일반적으로 사용되는 기본 클래스는 다음과 같습니다.
- 봉인되지 않은 특정 컨트롤(예: TextBox)
- 컨트롤 기본 클래스(Control, ContentControl, UserControl)
- 탐색 요소(Page, Frame)
- 패널 클래스(기본 클래스 Panel또는 봉인되지 않은 특정 구현(예: Grid)
UIElement 클래스는 Windows 런타임 API에서 많은 속성 및 메서드의 형식 매개 변수로 사용됩니다. 예를 들어 속성은 Child Border 주위에 그려지는 요소를 나타내는 단일 UIElement를 Border 사용합니다. 정의한 사용자 지정 컨트롤을 포함하여 이러한 속성에 대해 UIElement 파생 요소를 제공할 수 있습니다.
클래스는 UIElementCollection 강력한 형식의 UIElement 항목 컬렉션을 제공합니다. UIElementCollection 는 여러 자식 요소를 포함하는 개체의 속성에 대한 Children 형식으로 사용됩니다(예: 모든 Panel 클래스의 속성).
Uielement API 및 기능
UIElement는 DependencyObject다른 기본 요소인 확장되며 다양한 Windows 런타임 기능 영역에 대한 지원을 추가합니다.
사용자 상호 작용에 응답하기 위한 입력 및 이벤트
UI에서 표시되는 요소에 대한 대부분의 입력 동작은 UIElement 클래스에 정의되어 있습니다. 여기에는 키보드, 마우스, 터치, 끌어서 놓기 및 포커스 상호 작용에 대한 이벤트가 포함됩니다. 자세한 내용은 포인터 입력 처리, 키보드 상호 작용 및 사용자 지정 사용자 상호 작용을 참조하세요.
입력 및 사용자 상호 작용을 지원하는 UIElement의 눈에 띄는 API:
- 포인터 이벤트: PointerPressed, PointerReleased, PointerMoved, PointerEnteredPointerExited
- 키 처리 이벤트: KeyDownKeyUp
- 포커스: GotFocusLostFocus
- 포인터 캡처: CapturePointer, PointerCanceled, PointerCaptureLost, ReleasePointerCapturePointerCaptures
- 끌어서 놓기: DragOver, Drop, DragEnter, DragLeaveAllowDrop
- 기본 입력 처리 방법에 영향을 주는 속성: IsHitTestVisibleAllowDrop
제스처 및 조작
제스처 및 조작은 입력 및 사용자 상호 작용을 처리하는 방법이기도 합니다. 이러한 이벤트는 시스템이 디바이스 수준 입력 작업과 상호 작용하고 사용자 상호 작용으로 해석하는 방법을 나타내기 때문에 API는 여기에 별도로 나열됩니다. 조작은 꼬집기 및 스트레칭과 같은 동적 멀티 터치 상호 작용을 처리하는 방법입니다. 제스처와 조작은 함께 UWP 앱과의 터치 조작을 위한 터치 패턴을 제공합니다. 자세한 내용은 사용자 지정 사용자 상호 작용 및 터치 조작 디자인을 참조하세요.
제스처 및 조작을 지원하는 UIElement의 눈에 띄는 API:
- 제스처 이벤트: DoubleTapped, Holding, RightTappedTapped
- 조작 이벤트: ManipulationCompleted, ManipulationDelta, ManipulationInertiaStarting, ManipulationStartedManipulationStarting
- 제스처 및 조작 처리 방법에 영향을 주는 속성: IsHoldingEnabled 및 기타 Is*Enabled, ManipulationMode
기본 모양
및 Opacity 속성은 Visibility 특히 스타일, 템플릿 및 시각적 상태 내에서 UI에서 요소의 모양을 조정하는 데 자주 사용됩니다. , RenderTransform및 Transitions 속성은 Clip각각 UI 요소에 대한 상호 작용 및 다양한 모양을 생성하는 데 유용합니다.
기본 레이아웃
UIElement 클래스는 속성 및 메서드와 같은 DesiredSize 레이아웃 특성에 Arrange Measure 대한 시작점을 제공합니다. FrameworkElement 는 더 많은 레이아웃 기능을 추가합니다. 자세한 내용은 XAML 및 FrameworkElement을 사용하여 레이아웃 정의를 참조하세요.
라우트된 이벤트
UIElement의 대부분의 입력 이벤트는 라우트된 이벤트 입니다. 라우트된 이벤트는 이벤트가 처리되지 않은 상태로 유지되는 경우 부모 개체가 개체 트리의 자식 개체에서 입력 이벤트를 처리할 수 있도록 기본 제공 이벤트 처리 알림 시스템을 사용하도록 설정합니다. 이 입력 이벤트 동작은 입력 영역 그룹화 및 컨트롤 작성에 유용합니다. 자세한 내용은 이벤트 및 라우트된 이벤트 개요를 참조하세요.
라우트된 이벤트를 지원하는 UIElement의 눈에 띄는 API: AddHandler, RemoveHandler* 이벤트 속성.
기타 플랫폼 지원
- OnCreateAutomationPeer을 사용하면 클래스가 Microsoft UI 자동화 지원에 대한 사용자 지정 AutomationPeer 을 사용할 수 있습니다.
- RenderTransform, TransformToVisual, ProjectionCompositeMode및 CacheMode FindSubElementsForTouchTargeting 고급 UI 레이아웃 시나리오에 유용합니다.
UIElement 종속성 속성
UIElement 기본 요소 클래스의 많은 읽기-쓰기 속성은 종속성 속성입니다. 종속성 속성은 스타일 및 템플릿, 데이터 바인딩, XAML 리소스 참조 및 속성 변경 논리와 같은 C++, C# 또는 Visual Basic 사용하여 UWP 앱에 대한 몇 가지 기본 프로그래밍 모델 기능을 지원합니다. 종속성 속성 및 해당 속성이 지원하는 기능에 대한 자세한 내용은 종속성 속성 개요를 참조하세요.
UIElement 파생 클래스
UIElement에서 직접 파생되는 유일한 Windows 런타임 클래스는 .입니다FrameworkElement. 파생되는 FrameworkElement클래스 목록은 참조 항목의 "FrameworkElement 파생 클래스" 섹션을 FrameworkElement 참조하세요.
버전 기록
| Windows 버전 | SDK 버전 | 추가된 값 |
|---|---|---|
| 1607 | 14393 | AccessKey |
| 1607 | 14393 | AccessKeyDisplayDismissed |
| 1607 | 14393 | AccessKeyDisplayRequested |
| 1607 | 14393 | AccessKeyInvoked |
| 1607 | 14393 | AccessKeyScopeOwner |
| 1607 | 14393 | ContextCanceled |
| 1607 | 14393 | ContextFlyout |
| 1607 | 14393 | ContextRequested |
| 1607 | 14393 | ExitDisplayModeOnAccessKeyInvoked |
| 1607 | 14393 | IsAccessKeyScope |
| 1703 | 15063 | GettingFocus |
| 1703 | 15063 | GettingFocusEvent |
| 1703 | 15063 | HighContrastAdjustment |
| 1703 | 15063 | KeyTipHorizontalOffset |
| 1703 | 15063 | KeyTipPlacementMode |
| 1703 | 15063 | KeyTipVerticalOffset |
| 1703 | 15063 | 조명 |
| 1703 | 15063 | LosingFocus |
| 1703 | 15063 | LosingFocusEvent |
| 1703 | 15063 | NoFocusCandidateFound |
| 1703 | 15063 | NoFocusCandidateFoundEvent |
| 1703 | 15063 | StartBringIntoView |
| 1703 | 15063 | StartBringIntoView(BringIntoViewOptions) |
| 1703 | 15063 | TabFocusNavigation |
| 1703 | 15063 | XYFocusDownNavigationStrategy |
| 1703 | 15063 | XYFocusKeyboardNavigation |
| 1703 | 15063 | XYFocusLeftNavigationStrategy |
| 1703 | 15063 | XYFocusRightNavigationStrategy |
| 1703 | 15063 | XYFocusUpNavigationStrategy |
| 1709 | 16299 | CharacterReceived |
| 1709 | 16299 | CharacterReceivedEvent |
| 1709 | 16299 | GetChildrenInTabFocusOrder |
| 1709 | 16299 | KeyboardAccelerators |
| 1709 | 16299 | OnProcessKeyboardAccelerators |
| 1709 | 16299 | PreviewKeyDown |
| 1709 | 16299 | PreviewKeyDownEvent |
| 1709 | 16299 | PreviewKeyUp |
| 1709 | 16299 | PreviewKeyUpEvent |
| 1709 | 16299 | ProcessKeyboardAccelerators |
| 1709 | 16299 | TryInvokeKeyboardAccelerator |
| 1803 | 17134 | BringIntoViewRequested |
| 1803 | 17134 | BringIntoViewRequestedEvent |
| 1803 | 17134 | ContextRequestedEvent |
| 1803 | 17134 | KeyboardAcceleratorPlacementMode |
| 1803 | 17134 | KeyboardAcceleratorPlacementTarget |
| 1803 | 17134 | KeyTipTarget |
| 1803 | 17134 | OnBringIntoViewRequested |
| 1803 | 17134 | OnKeyboardAcceleratorInvoked |
| 1803 | 17134 | RegisterAsScrollPort |
| 1809 | 17763 | CanBeScrollAnchor |
| 1809 | 17763 | CenterPoint |
| 1809 | 17763 | OpacityTransition |
| 1809 | 17763 | PopulatePropertyInfo |
| 1809 | 17763 | PopulatePropertyInfoOverride |
| 1809 | 17763 | 회전 |
| 1809 | 17763 | RotationAxis |
| 1809 | 17763 | RotationTransition |
| 1809 | 17763 | 확장 |
| 1809 | 17763 | ScaleTransition |
| 1809 | 17763 | StartAnimation |
| 1809 | 17763 | StopAnimation |
| 1809 | 17763 | TransformMatrix |
| 1809 | 17763 | Translation |
| 1809 | 17763 | TranslationTransition |
| 1903 | 18362 | ActualOffset |
| 1903 | 18362 | ActualSize |
| 1903 | 18362 | 그림자 |
| 1903 | 18362 | UIContext |
| 1903 | 18362 | XamlRoot |
속성
메서드
이벤트
적용 대상
추가 정보
피드백
다음에 대한 사용자 의견 제출 및 보기
