Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding to a string value that should then bind to a Resource, what wrong here?
    text
    copied!<p>I have a class with the following properties: Message(string), Added(DateTime) and LogLevel(string)</p> <p>In my App.xaml i have the following:</p> <pre><code>&lt;Application.Resources&gt; &lt;ImageSource x:Key="Critical"&gt;Gfx/Log/Critical.png&lt;/ImageSource&gt; &lt;ImageSource x:Key="Info"&gt;Gfx/Log/Information.png&lt;/ImageSource&gt; &lt;ImageSource x:Key="Error"&gt;Gfx/Log/Error.png&lt;/ImageSource&gt; &lt;ImageSource x:Key="Warning"&gt;Gfx/Log/Warning.png&lt;/ImageSource&gt; &lt;/Application.Resources&gt; </code></pre> <p>The LogLevel in the above class can have one of the following 4 ImageSource resource values defined in the app.xaml file.</p> <p>I'm using the WPF Toolkit from codeplex: <a href="http://www.codeplex.com/wpf" rel="nofollow noreferrer">link text</a></p> <pre><code>&lt;my:DataGrid Grid.Column="0" Grid.Row="1" AutoGenerateColumns="False" Name="userLogGrid"&gt; &lt;my:DataGrid.Columns&gt; &lt;my:DataGridTextColumn Header="Added" Binding="{Binding Added}" /&gt; &lt;my:DataGridTextColumn Header="Message" Binding="{Binding Message}" /&gt; &lt;my:DataGridTextColumn Header="Message" Binding="{Binding LogLevel}" /&gt; &lt;my:DataGridTemplateColumn Header="Level"&gt; &lt;my:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;Image Source="{DynamicResource {Binding LogLevel}}" /&gt; &lt;/DataTemplate&gt; &lt;/my:DataGridTemplateColumn.CellTemplate&gt; &lt;/my:DataGridTemplateColumn&gt; &lt;/my:DataGrid.Columns&gt; &lt;/my:DataGrid&gt; </code></pre> <p>So ... the LogLevel are bound to the grid ... but my Image are not display ... I have no idea if this is the right way to do it ... or there are better ways ... maybe I have a bug in the code ....</p> <p>I'm not even sure how to debug this, since its xaml and I'm just started using it ... </p> <p>Any help are very appriciated ... </p> <p>This is my first "Stackoverflow" post ... so if the formating aint perfect ... I will learn my this ... </p>
 

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