We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

HubTile SfMosaicTile binding ImageList

Thread ID:

Created:

Updated:

Platform:

Replies:

115900 Feb 22,2014 08:46 AM Sep 7,2015 05:45 AM WinRT 11
loading
Tags: SfHubTile
cristovao
Asked On February 22, 2014 08:46 AM

Hi!
I have a GridView with HubTiles .. all goes well.
Now I'm trying to bind a List<string> to the ImageList

<syncFusion:SfMosaicTile  Width="173" 
                           Height="171" Header="{Binding Name}" ImageList="{Binding Icons}" >
                         
                        </syncFusion:SfMosaicTile>

But it does not show the images..
But if I do the usual 

<syncFusion:SfMosaicTile  Width="173" 
                           Height="171" Header="{Binding Name}" >
                            <syncFusion:SfMosaicTile.ImageList>
                                <syncFusion:ImageList>
                                    <x:String>ms-appdata:///local/M_Photos_WP_20131117_15_05_41_Refocus.jpg</x:String>
                                </syncFusion:ImageList>
                            </syncFusion:SfMosaicTile.ImageList>
                        </syncFusion:SfMosaicTile>
It works

Any tips?







Vignesh V [Syncfusion]
Replied On February 24, 2014 08:04 AM

Hi Cristovao,

 

We have prepared a sample to address your requirement 'To bind image list for SfMosaicTile'. In the sample we have created a property of type 'ImageList' and binded the list to it.Please find the sample in below attachment.

 

Please let us know if you have any queries.

 

Regards,

Vignesh V


Attachment: MossaicTile_115900_3de7dd8c.zip

cristovao
Replied On February 24, 2014 09:05 AM

Thank you for your solution

I've come across a complementary ideia. binding to a List<anything> and use a Converter do transform to ImageList

<syncFusion:SfMosaicTile  Width="173" 
                            Height="171" Header="{Binding Name}" ImageList="{Binding Converter={StaticResource ListToImageListConverter}}" />
public sealed class ListToImageListConverter : IValueConverter
   {
       public object Convert(object value, Type targetType, object parameter, string language)
       {
           ImageList list = new ImageList();
           var i = (Domain.Models.Ui.Item)value;
           if (i.IsFolder)
           {
               List<string> images = i.Icons;
               Debug.WriteLine(i.Path);
               int max = 0;
               if (images != null && images.Count > 0)
                   foreach (var item in images)
                   {
                       list.Add(item);
                       max++;
                       if (max > 8break;
                   }
               else
                   list.Add("ms-appdata:///local/default.jpg");
           }            else            {                list.Add("ms-appdata:///local/default.jpg");            }            return list;        }        public object ConvertBack(object value, Type targetType, object parameter, string language)        {            return !(value is bool && (bool)value);        }

Vignesh V [Syncfusion]
Replied On February 25, 2014 12:17 AM

Hi Cristovao,

 

Thank you for your update. Please let us know if you need further assistance.

 

Regards,
Vignesh V

 

 


Manuel De Leon
Replied On August 31, 2015 11:08 PM

Hi Cristovao,

 

Thank you for your update. Please let us know if you need further assistance.

 

Regards,
Vignesh V

 

 


Hi,
   Is there a way to bind the images into the imagelist somewhere from the pictures library. Instead of the string, use the BitmapImage as a stream?

thanks,
Manny

Mariappan S [Syncfusion]
Replied On September 1, 2015 05:14 AM

Hi Manuel,

We have prepared a workaround sample which tries to meet your requirement. In this sample we have created a property of type 'ObservableCollection<Image>' and binded the image collection to  ImageList property of SfMosaicTile control. We have used IValuConverter to convert from Image observable collection to ImageList collection. If your requirement is different from this sample, please provide more information about your requirement. It would be very helpful for us to resolve your problem earlier.

Please download the sample from the below link.

Sample link: MossaicTile_115900


Please let us know if you need further assistance.

Regards,
Mariappan S.  

Manuel De Leon
Replied On September 1, 2015 06:52 AM

Hi Manuel,

We have prepared a workaround sample which tries to meet your requirement. In this sample we have created a property of type 'ObservableCollection<Image>' and binded the image collection to  ImageList property of SfMosaicTile control. We have used IValuConverter to convert from Image observable collection to ImageList collection. If your requirement is different from this sample, please provide more information about your requirement. It would be very helpful for us to resolve your problem earlier.

Please download the sample from the below link.

Sample link: MossaicTile_115900


Please let us know if you need further assistance.

Regards,
Mariappan S.  

Hi Mariappan,
   Thanks for the prompt reply and sample. I will try the sample and replacing the Bitmap image source from URI to storage file. This storage file could be located somewhere in the local disk or one drive.

Manny

Mariappan S [Syncfusion]
Replied On September 2, 2015 09:53 AM

Hi Manuel,

Could you please confirm whether you are trying to load from DocumentLibrary images. If your requirement different from loading images from document library. Could please provide more information about your requirement. It would be very helpful for us to resolve your problem earlier.

Please let us know if you need further assistance.

Regards,
Mariappan S

Manuel De Leon
Replied On September 3, 2015 11:30 AM

Hi Mariappan,
    Yes, I am trying to load the images from the pictures library. It seems it won't load like this

<Notification:ImageList>

    <x:String>C:\\Users\\Manny\\Pictures\\DSC_0411.jpg</x:String>

</Notification:ImageList>


Please help.


Mariappan S [Syncfusion]
Replied On September 4, 2015 08:27 AM

Hi Manuel,

When the path is set as string, it will work only for the images stored in Local, Roaming, Temp app data and App(inside the application project) locations. For folders like Downloads, Picture library, Video library, Document library and Music library we have to set the Source property of Image element through C# as BitmapImage. ImageList of SfMosaicTile is a collection of string, bound to Source property of Image element in control template. So passing a string path for a Picture library image will not work.

Please let us know if you need further assistance on this.

Regards,
Mariappan S.

Manuel De Leon
Replied On September 4, 2015 11:22 AM

Hi Mariappan,
     I understand your explanation. So the control will not support the images that are located outside the package. Is there a way around this scenario?
All I need is to be able to use the images in the pictures library.

Thanks,
Manny

Mariappan S [Syncfusion]
Replied On September 7, 2015 05:45 AM

Hi Manuel,

We can only show images by using the ImageList property as a URL string. Currently we do not have any work around to show the Picture Library images in ImageList property of SfMosaicTile.

Please let us know if you need further assistance.

Regards,
Mariappan S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;