1

I can get 2 levels of PivotViewerItemTemplate to work just fine, but not three.

If I set one template at MaxWidth=130, the next at MaxWidth=400 and then a third with no MaxWidth, the second level starts transitioning into the 3rd at about 170 pixels and is no longer visible at all at only 280 pixels. I expect to see the 2nd level until it is 400 pixels wide.

Any tips on what I'm doing wrong here?

TIA

Graeme
  • 2,597
  • 8
  • 37
  • 50

1 Answers1

0

Your MaxWidth's need to be powers of two: 32, 64, 128 etc. You can then have as many levels as there are powers :) I've written a post explaining it in more detail here http://www.rogernoble.com/2012/04/02/picking-maxwidth-for-pivotviewer-semantic-zoom

RogerNoble
  • 392
  • 3
  • 13
  • That really means that there are only 3 practical levels: 128, 512 & >512. 256 is too close to 128 and the transition from level 2 to 3 happens in just one mouse wheel click. I don't get the relation between the border width & height of the tile and the maxwidth property - should width & height stay the same for all levels as in your example? – Graeme Mar 30 '13 at 10:31
  • I've not tried this - but your comment about powers-of-2 only applies if you are using the DeepZoom tiling to render your image. If you are using a custom item template then I would think that there is no reason to choose powers of two or anything else. If you are using images then it seems to me you could choose another tile size besides 256 that would be more relevant for your transitions, but if you are using deepzoom to do your images and want to apply some extra info to those images (or buttons) perhaps adorners are better? I say this without having tried. Roger has way more experience! – Gordon Mar 31 '13 at 10:57
  • Oh, I understood the PV is somehow using DeepZoom behind the scenes even for my custom templates. I tried setting my middle template from 512 to 450 and I'm back to square 1 - the last template is showing along with the middle one at less that 150 width. In fact, even at MaxWidth=511 it shows this behaviour. Setting it to 512 fixes it - my second template is active up until that width, then the 3rd one kicks in. So it looks like only 3 practical levels are possible. – Graeme Mar 31 '13 at 11:20
  • That's correct Graeme, even with custom item templates PV converts them to DeepZoom tiles on the client. You can keep going with powers of two and have templates for 1024, 2048 etc... but you reach the point where a single tile takes up the entire screen. At first glance it seems kinda silly to have templates that then get rendered as images, sliced and up served as a DeepZoom collection, but from Microsoft's perspective it's the simplest way to achieve templating with minimal effort. – RogerNoble Apr 01 '13 at 06:56