aadi kumary

aadi kumary

  • NA
  • 25
  • 18.6k

Displaying Image alternative in listbox (wpf application )

May 27 2014 1:44 AM
 Hi,
 
Displaying Image alternative in listbox   based on AlternationCount
this is my code ..but it is not displaying any image ...
 
is their any mistake... Help me  
 
 
 
 
<ListBox SelectionChanged="lstTiles_SelectionChanged" AlternationCount="2"
MouseDoubleClick="lstTiles_MouseDoubleClick"
x:Name="lstTiles"
Drop="lstTiles_Drop_1" AllowDrop="True"
ItemContainerStyle="{DynamicResource SimpleListBoxItem}"
Margin="0" >
<ListBox.ItemTemplate>
<DataTemplate>
<Canvas>
<TextBlock VerticalAlignment="Top" Text="{Binding Name}" FontSize="16" FontWeight="Bold"
Margin="90,20,0,0" Foreground="Black" />
<Image Source="Images\Tiles\Folder-n-design(right).png" Name="imgLoadRight" Margin="0,10,0,0" Loaded="imgLoad_Loaded_1" Visibility="Collapsed" />
<Image Source="Images\Tiles\Folder-n-design(center).png" Name="imgLoadCenter" Margin="0,100,0,0" Loaded="imgLoad_Loaded_1" Visibility="Collapsed" />
</Canvas>
<DataTemplate.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter TargetName="imgLoadRight" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter TargetName="imgLoadCenter" Property="Visibility" Value="Visible" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
 
 
Aadi kumar 
 

Answers (2)