ComponentResourceKey.TypeInTargetAssembly プロパティ

定義

リソース キーを定義する Type を取得または設定します。

public:
 property Type ^ TypeInTargetAssembly { Type ^ get(); void set(Type ^ value); };
public Type TypeInTargetAssembly { get; set; }
member this.TypeInTargetAssembly : Type with get, set
Public Property TypeInTargetAssembly As Type

プロパティ値

リソース キーを定義する型。

次の例は、ComponentResourceKey マークアップ拡張機能ComponentResourceKey含めてTypeInTargetAssemblyResourceId使用して を定義する方法を示しています。 その後、このリソースを外部アセンブリに配置し、要求で類似 ComponentResourceKey した を使用してリソースを要求するキー使用法でアクセスできます。

<Style 
    x:Key="{ComponentResourceKey 
        TypeInTargetAssembly={x:Type local:ColorPicker},
        ResourceId=ColorSliderStyle}"
    TargetType="{x:Type Slider}">

    <Setter Property="Minimum" Value="0"/>
    <Setter Property="Maximum" Value="255"/>
    <Setter Property="SmallChange" Value="1"/>
    <Setter Property="LargeChange" Value="51"/>
    <Setter Property="IsMoveToPointEnabled" Value="true"/>
    <Setter Property="Orientation" Value="Horizontal"/>
</Style>

注釈

XAML 情報については、「 ComponentResourceKey Markup Extension」を参照してください。

要素は ComponentResourceKey 、型を含むアセンブリのターゲットに基づいて、外部アセンブリからアクセスされるリソースのキーを定義するためにカスタム コンポーネントによって使用されます。 カスタム コンポーネントは、多くの場合、リソースが配置されているアセンブリ内に存在する必要がある新しい型を定義します。 一般に、これらの型には他の実装はありません。型は の参照要件 ComponentResourceKeyを満たすためにのみ存在します。

適用対象