ImageSource vs ImageList vs enumerate images in mixin

0
0

Hi Wisej,

we are widely using the ImageSource property for setting the image for various widgets, however, that does not work for TreeView (and TreeNode). These require the ImageList + ImageKey to be set.

Now, we are having an images mixin file, its attributed as embedded resource.

My idea is to create programatically on-the-fly the ImageList a populate it, at application startup, with images from this mixin. Then share this one image list for all tree views in project. And then, use the ImageKey for TreeNode.

Can you please advice on how to make this happen?

 

Thank you & regards,

Pavel Weiss

  • You must to post comments
0
0

Hi Pavel,

All theme resources are accessible using Application.Theme.

You can add them to an ImageList programatically:

this.imageList1.Images.Add(new ImageListEntry
{
    Name = "myImage"
    ImageSource = Application.Theme.Images["myImage"]
});

 

HTH,

Levie

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.