sql
php
c
xml
python
database
linux
android
mysql
silverlight
html5
json
algorithm
oracle
tsql
apache
php5
asp
api
postgresql
public class PhotoConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { if ((value is byte[]) && (value != null)) return Visibility.Visible; else return Visibility.Collapsed; } catch (Exception ex) { throw ex; return Visibility.Collapsed; } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }
<controls:PanoramaItem x:Name="Pano_Photos" Header="photos"> <ListBox x:Name="lstMemoriesPhoto" ItemsSource="{Binding MemoryList}"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged" x:Name="ListPhotoSelectionChangedEventTrigger"> <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding NavigateToDetailPage}" PassEventArgsToCommand="True"/> </i:EventTrigger> </i:Interaction.Triggers> <ListBox.ItemsPanel> <ItemsPanelTemplate> <toolkit:WrapPanel ItemWidth="130" ItemHeight="130"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Image Source="{Binding MemoryPhoto,Converter={StaticResource ByteImageConverter}}" Visibility="{Binding MemoryPhoto, Converter={StaticResource PhotoConverter}}" Margin="5"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </controls:PanoramaItem>