Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
En este artículo se enumeran las asignaciones que .NET realiza entre tipos de Windows Runtime (WinRT) y tipos de .NET en aplicaciones de Plataforma universal de Windows (UWP) escritas con código administrado. En estas aplicaciones, IntelliSense de Visual Studio muestra el tipo de .NET en lugar del tipo WinRT. Por ejemplo, si un método WinRT toma un parámetro de tipo cadena IVector><, IntelliSense muestra un parámetro de tipo cadena IList<>. Del mismo modo, en un componente de Windows Runtime escrito con código administrado, se usa el tipo .NET en firmas de miembro. Cuando la Herramienta de exportación de metadatos de Windows Runtime (Winmdexp.exe) genera el componente de Windows Runtime, el tipo de .NET se traduce en el tipo winRT correspondiente.
La mayoría de los tipos que tienen el mismo nombre de espacio de nombres y nombre de tipo en WinRT y .NET son estructuras (o tipos asociados a estructuras, como enumeraciones). En WinRT, las estructuras no tienen miembros que no sean campos y requieren tipos de asistentes, que .NET oculta. Las versiones de .NET de estas estructuras tienen propiedades y métodos que proporcionan la funcionalidad de los tipos auxiliares ocultos.
Nota:
Para obtener una lista de asignaciones entre los tipos de WinRT y .NET en el contexto de las aplicaciones de escritorio destinadas a .NET y que usan C#/WinRT, consulte Asignaciones de .NET de tipos de WinRT en C#/WinRT.
Tipos de WinRT que se asignan a tipos de .NET con el mismo nombre y espacio de nombres
En el ensamblado de .NET System.ObjectModel.dll
Espacio de nombres | Tipo |
---|---|
Windows.UI.Xaml.Input | ICommand |
En el System.Runtime.WindowsRuntime.dll de ensamblado de .NET
Espacio de nombres | Tipo |
---|---|
Windows.Foundation | Punto |
Windows.Foundation | Rect |
Windows.Foundation | Size |
Windows.UI | Color |
En el System.Runtime.WindowsRuntime.UI.Xaml.dll de ensamblado de .NET
Espacio de nombres | Tipo |
---|---|
Windows.UI.Xaml | CornerRadius |
Windows.UI.Xaml | Duration |
Windows.UI.Xaml | DurationType |
Windows.UI.Xaml | GridLength |
Windows.UI.Xaml | GridUnitType |
Windows.UI.Xaml | Thickness |
Windows.UI.Xaml.Controls.Primitives | GeneratorPosition |
Windows.UI.Xaml.Media | Matriz |
Windows.UI.Xaml.Media.Animation | KeyTime |
Windows.UI.Xaml.Media.Animation | RepeatBehavior |
Windows.UI.Xaml.Media.Animation | RepeatBehaviorType |
Windows.UI.Xaml.Media.Media3D | Matrix3D |
Tipos de WinRT que se asignan a tipos de .NET con un nombre o un espacio de nombres diferente
En el ensamblado de .NET System.ObjectModel.dll
Tipo o espacio de nombres de WinRT | Tipo o espacio de nombres de .NET |
---|---|
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) |
En el System.Runtime.dll de ensamblado de .NET
Tipo o espacio de nombres de WinRT | Tipo o espacio de nombres de .NET |
---|---|
AttributeUsageAttribute (Windows.Foundation.Metadata) | AttributeUsageAttribute (System) |
AttributeTargets (Windows.Foundation.Metadata) | AttributeTargets (System) |
DateTime (Windows.Foundation) | DateTimeOffset (Sistema) |
EventHandler<T> (Windows.Foundation) | EventHandler<T> (Sistema) |
HResult (Windows.Foundation) | Exception (Sistema) |
IReference<T> (Windows.Foundation) | Nullable<T> (System) |
TimeSpan (Windows.Foundation) | TimeSpan (System) |
Uri (Windows.Foundation) | Uri (System) |
IClosable (Windows.Foundation) | IDisposable (Sistema) |
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) |
En el System.Runtime.InteropServices.WindowsRuntime.dll de ensamblado de .NET
Tipo o espacio de nombres de WinRT | Tipo o espacio de nombres de .NET |
---|---|
EventRegistrationToken (Windows.Foundation) | EventRegistrationToken (System.Runtime.InteropServices.WindowsRuntime) |