Windows Phone dynamic layout in data template -
i need have dynamic layout within list box item.
example of such layout news feed on facebook. simplify, let's narrow downwards 1 news item type: added n photos. have algorithm takes image sizes , produces optimal layout.
i don't want have 20 images bound width, height, margin, visibility.
i have have virtualization enabled.
how can done on windows phone platform?
easiest method:
place itemscontrol within list box item. set itemscontrol's width , height layout algorithm tells to. set itemspanel grid. in info template, place image, set margins layout algorithm tells to.
images wont virtualized, listbox items (containing whole itemscontrol images) will.
most right method (only required if have many images and/or big images single item exceeds 2048px):
inherit e.g. virtualizingstackpanel, override measureoverride , arrangeoverride implement custom layout, spend ~2-10 days fixing virtualization-related issues in code. way virtualizes everything, time estimate (i never did myself), , can't guarantee you'll succeed.
intermediate method: redesign layout algorithm layout images in rows. utilize single virtualizing listbox or itemscontrol, split item smaller rows, each row containing single row of images.
windows-phone-7 windows-phone-8
No comments:
Post a Comment