Nota
O acesso a esta página requer autorização. Podes tentar iniciar sessão ou mudar de diretório.
O acesso a esta página requer autorização. Podes tentar mudar de diretório.
Este artigo lista os mapeamentos que o .NET faz entre os tipos do WinRT (Tempo de Execução do Windows) e os tipos do .NET em aplicativos UWP (Plataforma Universal do Windows) escritos com código gerenciado. Nesses aplicativos, o Visual Studio IntelliSense mostra o tipo .NET em vez do tipo WinRT. Por exemplo, se um método WinRT usar um parâmetro do tipo cadeia de caracteres> IVector<, o IntelliSense mostrará um parâmetro do tipo cadeia de caracteres> IList<. Da mesma forma, em um componente do Tempo de Execução do Windows escrito com código gerenciado, você usa o tipo .NET nas assinaturas de membro. Quando a Ferramenta de Exportação de Metadados do Tempo de Execução do Windows (Winmdexp.exe) gera seu componente do Tempo de Execução do Windows, o tipo .NET é convertido no tipo WinRT correspondente.
A maioria dos tipos que têm o mesmo nome de namespace e nome de tipo no WinRT e no .NET são estruturas (ou tipos associados a estruturas, como enumerações). No WinRT, as estruturas não têm membros além de campos e exigem tipos de auxiliar, que são ocultados pelo .NET. As versões do .NET dessas estruturas têm propriedades e métodos que fornecem a funcionalidade dos tipos auxiliares ocultos.
Observação
Para obter uma lista de mapeamentos entre os tipos WinRT e .NET no contexto de aplicativos da área de trabalho direcionados ao .NET e usam C#/WinRT, consulte mapeamentos .NET de tipos WinRT em C#/WinRT.
Tipos do WinRT que são mapeados para tipos .NET com o mesmo nome e namespace
No assembly do .NET System.ObjectModel.dll
| Namespace | Tipo |
|---|---|
| Windows.UI.Xaml.Input | ICommand |
No assembly do .NET System.Runtime.WindowsRuntime.dll
| Namespace | Tipo |
|---|---|
| Windows.Foundation | Point |
| Windows.Foundation | Rect |
| Windows.Foundation | Tamanho |
| Windows.UI | Color |
No assembly do .NET System.Runtime.WindowsRuntime.UI.Xaml.dll
| Namespace | Tipo |
|---|---|
| Windows.UI.Xaml | CornerRadius |
| Windows.UI.Xaml | Duration |
| Windows.UI.Xaml | DurationType |
| Windows.UI.Xaml | GridLength |
| Windows.UI.Xaml | GridUnitType |
| Windows.UI.Xaml | Espessura |
| 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 do WinRT mapeados para tipos .NET com um nome e/ou namespace diferente
No assembly do .NET System.ObjectModel.dll
| Tipo/namespace do WinRT | Tipo/namespace do .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) |
No assembly do .NET System.Runtime.dll
| Tipo/namespace do WinRT | Tipo/namespace do .NET |
|---|---|
| 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) |
No assembly do .NET System.Runtime.InteropServices.WindowsRuntime.dll
| Tipo/namespace do WinRT | Tipo/namespace do .NET |
|---|---|
| EventRegistrationToken (Windows.Foundation) | EventRegistrationToken (System.Runtime.InteropServices.WindowsRuntime) |