Hi,
I have a class with the following properties: Message(string), Added(DateTime) and LogLevel(string)
In my App.xaml i have the following:
<Application.Resources>
<ImageSource x:Key="Critical">Gfx/Log/Critical.png</ImageSource>
<ImageSource x:Key="Info">Gfx/Log/Information.png</ImageSource>
<ImageSource x:Key="Error">Gfx/Log/Error.png</ImageSource>
<ImageSource x:Key="Warning">Gfx/Log/Warning.png</ImageSource>
</Application.Resources>
The LogLevel in the above class can have one of the following 4 ImageSource resource values defined in the app.xaml file.
I'm using the WPF Toolkit from codeplex: link text
<my:DataGrid Grid.Column="0" Grid.Row="1" AutoGenerateColumns="False" Name="userLogGrid">
<my:DataGrid.Columns>
<my:DataGridTextColumn Header="Added" Binding="{Binding Added}" />
<my:DataGridTextColumn Header="Message" Binding="{Binding Message}" />
<my:DataGridTextColumn Header="Message" Binding="{Binding LogLevel}" />
<my:DataGridTemplateColumn Header="Level">
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{DynamicResource {Binding LogLevel}}" />
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>
</my:DataGrid.Columns>
</my:DataGrid>
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 ....
I'm not even sure how to debug this, since its xaml and I'm just started using it ...
Any help are very appriciated ...
This is my first "Stackoverflow" post ... so if the formating aint perfect ... I will learn my this ...