Lightswitch Coverflow Image Display

1 posts, 0 answers
  1. Miles
    Miles avatar
    1 posts
    Member since:
    Aug 2012

    Posted 05 Aug 2012 Link to this post


    I'm having trouble loading the images from an SQL 2008 database (saved as image) into the the coverflow.
    None of the examples I have looked at show the correct way to do this within Lightswitch.
    Since I am using Lightswitch I am usign an older version of the Telerik controls that still support Silverlight 4.

    I have got the coverflow to display the correct data from the database however when trying to get the image to display the whole page breaks.

    Below is the Relevant XAML: (with the Image section commented out as it breaks the project)
    <Grid x:Name="LayoutRoot"
           <telerik:RadCoverFlow ItemsSource="{Binding Screen.honorsStudents}"
                                 SelectedItem="{Binding Screen.honorsStudents.SelectedItem, Mode=TwoWay}">           
                       <StackPanel Background="LightBlue" MinWidth="300" Orientation="Vertical">
                           <TextBlock Text="First Name:" />
                           <TextBlock Text="{Binding FirstName}"
                                      Margin="5" />
                           <TextBlock Text="Surname:" />
                           <TextBlock Text="{Binding SurName}"
                                      Margin="5" />
                           <TextBlock Text="Image:" />
                           <!--<Image Source="{Binding picture, Converter={StaticResource ImageConverter}}" />-->

    Here is the Converter being used:
    public class ImageConverter : IValueConverter
               public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
                   BitmapImage img = new BitmapImage();
                   using (MemoryStream stream = new MemoryStream(value as byte[]))
                   return img;
               public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
                   return null;

    Any help would be greatly appreciated. (even a link to a lightswitch project that does load images fro ma database)
    Thank you for your time,
    Miles Barnett
Back to Top