.NET-Zuordnungen von Windows-Runtime-Typen in UWP-Apps
In diesem Artikel werden die Zuordnungen aufgeführt, die .NET zwischen winRT-Typen (Windows-Runtime) und .NET-Typen in Universelle Windows-Plattform(UWP)-Apps erstellt, die mit verwaltetem Code geschrieben wurden. In diesen Apps zeigt Visual Studio IntelliSense den .NET-Typ anstelle des WinRT-Typs an. Wenn beispielsweise eine WinRT-Methode einen Parameter vom Typ IVector<string> akzeptiert, zeigt IntelliSense einen Parameter vom Typ IList<string> an. Ebenso verwenden Sie in einer Windows-Runtime Komponente, die mit verwaltetem Code geschrieben wurde, den .NET-Typ in Membersignaturen. Wenn das Windows-Runtime Metadata Export Tool (Winmdexp.exe) Ihre Windows-Runtime-Komponente generiert, wird der .NET-Typ in den entsprechenden WinRT-Typ übersetzt.
Die meisten Typen, die in WinRT und .NET denselben Namespace- und Typnamen aufweisen, sind Strukturen (oder Typen, die Strukturen zugeordnet sind, z. B. Enumerationen). In WinRT haben Strukturen keine anderen Member als Felder und erfordern Hilfstypen, die in .NET ausgeblendet sind. Die .NET-Versionen dieser Strukturen verfügen über Eigenschaften und Methoden, die die Funktionalität der ausgeblendeten Hilfstypen bereitstellen.
Hinweis
Eine Liste der Zuordnungen zwischen WinRT- und .NET-Typen im Kontext von Desktop-Apps, die auf .NET ausgerichtet sind und C#/WinRT verwenden, finden Sie unter .NET-Zuordnungen von WinRT-Typen in C#/WinRT.
WinRT-Typen, die .NET-Typen mit demselben Namen und Namespace zugeordnet sind
In .NET-AssemblySystem.ObjectModel.dll
Namespace | Typ |
---|---|
Windows.UI.Xaml.Input | ICommand |
In .NET-AssemblySystem.Runtime.WindowsRuntime.dll
Namespace | Typ |
---|---|
Windows.Foundation | Point |
Windows.Foundation | Rect |
Windows.Foundation | Size |
Windows.UI | Color |
In .NET-AssemblySystem.Runtime.WindowsRuntime.UI.Xaml.dll
Namespace | Typ |
---|---|
Windows.UI.Xaml | CornerRadius |
Windows.UI.Xaml | Duration |
Windows.UI.Xaml | DurationTyp |
Windows.UI.Xaml | GridLength |
Windows.UI.Xaml | GridUnitType |
Windows.UI.Xaml | Stärke |
Windows.UI.Xaml.Controls.Primitives | GeneratorPosition |
Windows.UI.Xaml.Media | Matrix |
Windows.UI.Xaml.Media.Animation | KeyTime |
Windows.UI.Xaml.Media.Animation | RepeatBehavior |
Windows.UI.Xaml.Media.Animation | RepeatBehaviorTyp |
Windows.UI.Xaml.Media.Media3D | Matrix3D |
WinRT-Typen, die .NET-Typen mit einem anderen Namen und/oder Namespace zugeordnet sind
In .NET-AssemblySystem.ObjectModel.dll
WinRT-Type/-Namespace | .NET-Type/-Namespace |
---|---|
INotifyCollectionChanged (Windows.UI.Xaml.Interop) | INotifyCollectionChanged (System.Collections.Specialized) |
NotifyCollectionChangedEventHandler (Windows.UI.Xaml.Interop) | NotifyCollectionChangedEventHandler (System.Collections.Specialized) |
NotifyCollectionChangedEventArgs (Windows.UI.Xaml.Interop) | NotifyCollectionChangedEventArgs (System.Collections.Specialized) |
NotifyCollectionChangedAction (Windows.UI.Xaml.Interop) | NotifyCollectionChangedAction (System.Collections.Specialized) |
INotifyPropertyChanged (Windows.UI.Xaml.Data) | INotifyPropertyChanged (System.ComponentModel) |
PropertyChangedEventHandler (Windows.UI.Xaml.Data) | PropertyChangedEventHandler (System.ComponentModel) |
PropertyChangedEventArgs (Windows.UI.Xaml.Data) | PropertyChangedEventArgs (System.ComponentModel) |
In .NET-AssemblySystem.Runtime.dll
WinRT-Type/-Namespace | .NET-Type/-Namespace |
---|---|
AttributeUsageAttribute (Windows.Foundation.Metadata) | AttributeUsageAttribute (System) |
AttributeTargets (Windows.Foundation.Metadata) | AttributeTargets (System) |
DateTime (Windows.Foundation) | DateTimeOffset (System) |
EventHandler<T> (Windows.Foundation) | EventHandler<T> (System) |
HResult (Windows.Foundation) | Exception (System) |
IReference<T> (Windows.Foundation) | Nullable<T> (System) |
TimeSpan (Windows.Foundation) | TimeSpan (System) |
Uri (Windows.Foundation) | Uri (System) |
IClosable (Windows.Foundation) | IDisposable (System) |
IIterable<T> (Windows.Foundation.Collections) | IEnumerable<T> (System.Collections.Generic) |
IVector<T> (Windows.Foundation.Collections) | IList<T> (System.Collections.Generic) |
IVectorView<T> (Windows.Foundation.Collections) | IReadOnlyList<T> (System.Collections.Generic) |
IMap<K,V> (Windows.Foundation.Collections) | IDictionary<TKey,TValue> (System.Collections.Generic) |
IMapView<K,V> (Windows.Foundation.Collections) | IReadOnlyDictionary<TKey,TValue> (System.Collections.Generic) |
IKeyValuePair<K,V> (Windows.Foundation.Collections) | KeyValuePair<TKey,TValue> (System.Collections.Generic) |
IBindableIterable (Windows.UI.Xaml.Interop) | IEnumerable (System.Collections) |
IBindableVector (Windows.UI.Xaml.Interop) | IList (System.Collections) |
TypeName (Windows.UI.Xaml.Interop) | Type (System) |
In .NET-AssemblySystem.Runtime.InteropServices.WindowsRuntime.dll
WinRT-Type/-Namespace | .NET-Type/-Namespace |
---|---|
EventRegistrationToken (Windows.Foundation) | EventRegistrationToken (System.Runtime.InteropServices.WindowsRuntime) |
Verwandte Themen
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für