Chargement de WPF Style de Fichier de Ressources

Je suis en train de charger WPF Style de autres fichier de Bibliothèque de contrôles Personnalisés WPF
mais je suis l'échec du chargement, voici ma solution.

La solution contient deux projets

  1. WpfTestControls de Type WPF Bibliothèque de contrôles Personnalisés
  2. WpfTestApp de type WPF Application de la Bibliothèque qui fait référence aux WpfTestControls

MainWindow.à partir de WPF xaml Bibliothèque de l'Application

<Window.Resources>
    <Style x:Key="TempStyle" TargetType="{x:Type TextBox}">
        <Setter Property="BorderBrush" Value="Green"/>
    </Style>
</Window.Resources>
<Grid>
    <TextBox Height="50px" Width="100px" Style="{DynamicResource TempStyle}"/>
</Grid>

Générique.à partir de WPF xaml Bibliothèque de contrôles Personnalisés

<ResourceDictionary
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/WpfTestControls;component/TextBoxStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>

TextBoxStyle.à partir de WPF xaml Bibliothèque de contrôles Personnalisés

<ResourceDictionary 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="TempStyle" TargetType="{x:Type TextBox}">
    <Setter Property="BorderBrush" Value="Green"/>
</Style>

Mon AssemblyInfo.cs fichier contient les éléments suivants

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page, 
//or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page, 
//app, or any theme specific resource dictionaries))]

Mais j'ai toujours l'échec du chargement du Style.
Si je suis en utilisant les utilisez pas le Générique.xaml tout ce beau travail pour exemple, le code suivant fonctionne comme prévu

<Window x:Class="WpfTestApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">

<Window.Resources>
    <Style x:Key="TempStyle" TargetType="{x:Type TextBox}">
        <Setter Property="BorderBrush" Value="Green"/>
    </Style>
</Window.Resources>
<Grid>
    <TextBox Height="50px" Width="100px" Style="{StaticResource TempStyle}"/>
</Grid>

Ce que je fais mal ?
Merci d'avance

OriginalL'auteur Robob | 2011-10-13