次の方法で共有


.NET Framework での Windows ランタイム型の対応付け

次の表は、.NET Framework が Windows ランタイム 型と .NET Framework 型の間で行うマッピングを示します。マネージ コードで記述された Windows ストア アプリでは、IntelliSense は Windows ランタイム型ではなく .NET Framework の型を示します。たとえば、Windows ランタイム メソッドが IVector<string> 型のパラメーターを取る場合、IntelliSense は型 IList<string> のパラメーターを示します。同様に、マネージ コードで記述された Windows ランタイム コンポーネントでは .NET Framework 型をメンバーのシグニチャ内で使用します。Windows ランタイム メタデータ エクスポート ツール (Winmdexp.exe) が Windows ランタイム コンポーネントを生成すると、.NET Framework の型は Windows ランタイム の対応する型になります。

Windows ランタイム と .NET Framework の両方で同じ名前空間名と型名を持つ型の大部分は、構造体 (または列挙体のような構造体に関連付けられている型) です。Windows ランタイム では、構造体にはフィールド以外にメンバーがなく、.NET Framework が非表示にするヘルパー型が必要です。これらの構造体の .NET Framework バージョンには、非表示のヘルパー型の機能を提供するプロパティとメソッドがあります。

Windows ランタイム でのプログラミングを簡略化するために .NET Framework が Windows メタデータを使用する方法の詳細については、Windows の開発センターから「CLR and the Windows Runtime (CLR および Windows ランタイム)」ホワイト ペーパーをダウンロードします。

表 1: Windows ランタイム 型。異なる名前や名前空間を持つ .NET Framework にマップする。

Windows ランタイム 型/名前空間

.NET Framework 型/名前空間

.NET Framework アセンブリ

AttributeUsageAttribute (Windows.Foundation.Metadata)

AttributeUsageAttribute (System)

System.Runtime.dll

AttributeTargets (Windows.Foundation.Metadata)

AttributeTargets (System)

System.Runtime.dll

DateTime (Windows.Foundation)

DateTimeOffset (System)

System.Runtime.dll

EventHandler<T> (Windows.Foundation)

EventHandler<T> (System)

System.Runtime.dll

EventRegistrationToken (Windows.Foundation)

EventRegistrationToken (System.Runtime.InteropServices.WindowsRuntime)

System.Runtime.InteropServices.WindowsRuntime.dll

HResult (Windows.Foundation)

Exception (System)

System.Runtime.dll

IReference<T> (Windows.Foundation)

Nullable<T> (System)

System.Runtime.dll

TimeSpan (Windows.Foundation)

TimeSpan (System)

System.Runtime.dll

Uri (Windows.Foundation)

Uri (System)

System.Runtime.dll

IClosable (Windows.Foundation)

IDisposable (System)

System.Runtime.dll

IIterable<T> (Windows.Foundation.Collections)

IEnumerable<T> (System.Collections.Generic)

System.Runtime.dll

IVector<T> (Windows.Foundation.Collections)

IList<T> (System.Collections.Generic)

System.Runtime.dll

IVectorView<T> (Windows.Foundation.Collections)

IReadOnlyList<T> (System.Collections.Generic)

System.Runtime.dll

IMap<K,V> (Windows.Foundation.Collections)

IDictionary<TKey,TValue> (System.Collections.Generic)

System.Runtime.dll

IMapView<K,V> (Windows.Foundation.Collections)

IReadOnlyDictionary<TKey,TValue> (System.Collections.Generic)

System.Runtime.dll

IKeyValuePair<K,V> (Windows.Foundation.Collections)

KeyValuePair<TKey,TValue> (System.Collections.Generic)

System.Runtime.dll

IBindableIterable (Windows.UI.Xaml.Interop)

IEnumerable (System.Collections)

System.Runtime.dll

IBindableVector (Windows.UI.Xaml.Interop)

IList (System.Collections)

System.Runtime.dll

INotifyCollectionChanged (Windows.UI.Xaml.Interop)

INotifyCollectionChanged (System.Collections.Specialized)

System.ObjectModel.dll

NotifyCollectionChangedEventHandler (Windows.UI.Xaml.Interop)

NotifyCollectionChangedEventHandler (System.Collections.Specialized)

System.ObjectModel.dll

NotifyCollectionChangedEventArgs (Windows.UI.Xaml.Interop)

NotifyCollectionChangedEventArgs (System.Collections.Specialized)

System.ObjectModel.dll

NotifyCollectionChangedAction (Windows.UI.Xaml.Interop)

NotifyCollectionChangedAction (System.Collections.Specialized)

System.ObjectModel.dll

INotifyPropertyChanged (Windows.UI.Xaml.Data)

INotifyPropertyChanged (System.ComponentModel)

System.ObjectModel.dll

PropertyChangedEventHandler (Windows.UI.Xaml.Data)

PropertyChangedEventHandler (System.ComponentModel)

System.ObjectModel.dll

PropertyChangedEventArgs (Windows.UI.Xaml.Data)

PropertyChangedEventArgs (System.ComponentModel)

System.ObjectModel.dll

TypeName (Windows.UI.Xaml.Interop)

Type (System)

System.Runtime.dll

    

表 2: Windows ランタイム 型。同じ名前や名前空間を持つ .NET Framework にマップする。

名前空間

Type

.NET Framework アセンブリ

Windows.UI

Color

System.Runtime.WindowsRuntime.dll

Windows.Foundation

Point

System.Runtime.WindowsRuntime.dll

Windows.Foundation

Rect

System.Runtime.WindowsRuntime.dll

Windows.Foundation

Size

System.Runtime.WindowsRuntime.dll

Windows.UI.Xaml.Input

ICommand

System.ObjectModel.dll

Windows.UI.Xaml

CornerRadius

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml

Duration

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml

DurationType

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml

GridLength

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml

GridUnitType

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml

Thickness

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Controls.Primitives

GeneratorPosition

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Media

Matrix

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Media.Animation

KeyTime

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Media.Animation

RepeatBehavior

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Media.Animation

RepeatBehaviorType

System.Runtime.WindowsRuntime.UI.Xaml.dll

Windows.UI.Xaml.Media.Media3D

Matrix3D

System.Runtime.WindowsRuntime.UI.Xaml.dll

参照

概念

C++ および Visual Basic での Windows ランタイム コンポーネントの作成