Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot find converter resource
    primarykey
    data
    text
    <p>I have a WPF Solution with 2 projects, the first one (ResourcesLibrary) contains common styles and common resources. The other is the WPF application.</p> <p>I created a style for DataGridRows in the ResourcesLibrary <strong>generic.xaml</strong> file:</p> <pre><code>&lt;Style x:Key="DGRowStyle" TargetType="{x:Type DataGridRow}"&gt; &lt;Setter Property="ValidationErrorTemplate"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate&gt; &lt;Image Source="/Resources/stop.png" ToolTip = "{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Path=(Validation.Errors), Converter={StaticResource errorConverter]}}"/&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; </code></pre> <p></p> <p>I added the .cs converter files to the ResourcesLibrary project:</p> <pre><code>namespace ResourceLibrary { public class ErrorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var errors = value as ReadOnlyObservableCollection&lt;ValidationError&gt;; if (errors == null) return ""; return errors.Count &gt; 0 ? errors[0].ErrorContent : ""; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } } </code></pre> <p>And added the reference and the static resource:</p> <pre><code>xmlns:my="clr-namespace:ResourceLibrary" &lt;!-- CONVERTERS --&gt; &lt;my:ErrorConverter x:Key="errorConverter" /&gt; </code></pre> <p>But at runtime when, in the main project, I use the DataGridRow style defined in the ResourcesLibrary I get this error:</p> <p><strong>{"Cannot find resource named 'errorConverter]'. Resource names are case sensitive."}</strong></p> <p>Do I need to have another project inside my solution for the converters I will use?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload