RSS

Inside PivotViewer v2. Episode 1, Legacy Support

13 May

Welcome to the first in a series of video blog posts where we’ll be looking at what’s new for PivotViewer v2 in Silverlight 5.

In this episode we’ll take a deep-dive into PivotViewer v2 and look at what legacy support is available to all those that have created static, server-side cxml collections. We’ll also see some great dynamic benefits that can be applied to these existing collections with v2.

Please leave comments, feedback and any suggestions for things you’d like to see in this series.

Inside PivotViewer v2. Episode 1, Legacy Support from Chris Arnold on Vimeo.

Here are the links to the references I make at the end of the video:

Tony Champion (.Net Rocker)
http://tonychampion.net

Xpert360
http://xpert360.com

Kingsley Uyi Idehen
http://twitter.com/kidehen

Advertisements
 
11 Comments

Posted by on May 13, 2011 in PivotViewer

 

Tags: , , , , , ,

11 responses to “Inside PivotViewer v2. Episode 1, Legacy Support

  1. Chris Arnold

    May 13, 2011 at 5:45 pm

    Apologies for the small font-size in the code examples.

     
  2. yinyangme

    May 16, 2011 at 3:54 pm

    Chris,Thanks for this. I also have a live PivtoViewer application at http://mcpivot.com and want to move it over to the new v2 platform. Are the bits available from the PivotViewer team for me to get started?Jim McCurdy

     
  3. smitty3268

    June 4, 2011 at 5:25 am

    This looks great. HD video or bigger fonts would be good. Can't wait for the ability to modify pivotitem properties like that without forcing people to reload the collection afterwards!Questions – when merging those 2 collections of PivotItems at the end, you were still removing each one from the in-memory PivotViewer even though all you were doing was copying it's properties into a new item. Is it faster (and possible) to avoid that Remove call?With my current application, loading collections is quite slow when the # of items gets > 2,000 or 3,000. Is there a better way to handle this now? Or is this bottleneck being addressed? I was thinking of perhaps loading the first 500 or so right away, and then loading a new cxml file with all items in the background to replace it, but i'm not sure what kind of experience that would give the user. My cxml files are all entirely dynamically generated, so is there now a better way to do this?Some other points i'd like to see addressed in future videos:1. Modifying the image on the fly (in pivotviewer memory) – can we draw onto the images? Can we adjust brightness, things like that?2. Setting the viewstate and currently viewed items. My current app allows users to select images out of the collection (and adds them to a listview) then click a button and view only those images in the collection. The only way i found to do this was to add a unique property id and add each of those into the viewstate and then call loadcollection. Is there a better way of doing this – such as just setting the values in the viewableitems property (or whatever it's called)?3. On that topic, one of the big challenges we had was allowing people to select images easily. We ended up adding a Select button to the image and that would add it to the selected list (as well as hitting the space bar when zoomed in to an image). I added a little hack to detect if the shift key was pressed and mark the beginning/end of a series of images. What i really want is just the ability to do a shift-click and control-click to add images like you would do with files in explorer. Will something like that be possible?

     
  4. smitty3268

    June 4, 2011 at 5:35 am

    Oh, another thing a few users have complained about was the animations. Will there be a way to turn them off, so that hitting the arrow keys to move to new images will instantly change the image show rather than scrolling it over into view?

     
  5. Geoff

    October 25, 2011 at 7:21 pm

    Hi Chris, great post its been some time now any chance you could give us the next episode in this series now? Also any chance you could provide a link to the HD version of the video. Again great post thanks

     
    • goodcoffeegoodcode

      October 26, 2011 at 4:11 pm

      Hi Geoff,

      Thanks for the positive feedback :). I have considered doing another video in the series but all my time is currently spent working on TweetPivot and PhotoPivot.

      I’ll try to post some non-video posts though – they take much less time.

      Cheers,

      Chris

       
      • Geoff

        October 26, 2011 at 9:12 pm

        Sounds really good would be nice to see whats possible now with a really big collection perhaps out of browser.

        Cheers

        Geoff

         
  6. John Tomaselli

    March 2, 2012 at 12:23 am

    Hi,
    I’ve just tried to update my static cxml collections from SL4/PV1 to SL5/PV2. I modified code as shown below and only the images show up and are functional. No text for filter, sort, search or record display shows up.
    Any help is much appreciated and thanks,
    John
    XAML:

    Code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using System.Windows.Controls.Pivot;

    namespace SLPivotViewer
    {
    public partial class MainPage : UserControl
    {
    public MainPage()
    {
    InitializeComponent();

    CxmlCollectionSource _cxml;

    _cxml = new CxmlCollectionSource(new Uri(“http://www.gtz.com/Pivots/MRGTest/Kiosk1.cxml”, UriKind.Absolute));
    pv1.PivotProperties = _cxml.ItemProperties.ToList();
    pv1.ItemTemplates = _cxml.ItemTemplates;
    pv1.ItemsSource = _cxml.Items;
    }
    }
    }
    CXML Sample:

    Untitled

    Waning Moon

    A Slice of Fruit

    Crane

    Untitled

    Untitled

    Untitled

    France-Terrace

     
  7. John Tomaselli

    March 2, 2012 at 12:26 am

    CXML:
    CXML Sample:
    <?xml version=”1.0″ encoding=”utf-8″?>

    <FacetCategories>
    <FacetCategory Name=”Media” Type=”String” p:IsFilterVisible=”true” p:IsMetaDataVisible=”true” p:IsWordWheelVisible=”true”>
    <Extension>
    <p:SortOrder Name=”Media”>
    <p:SortValue Value=”black ink and gouache on paper” />
    <p:SortValue Value=”black ink and red watercolor on paper” />
    <p:SortValue Value=”black ink and wash on paper” />
    <p:SortValue Value=”black ink and watercolor on paper” />
    <p:SortValue Value=”black ink on paper” />
    <p:SortValue Value=”bronze” />
    <p:SortValue Value=”Bronze with paint” />
    <p:SortValue Value=”collage” />
    <p:SortValue Value=”collage and pastel on paper” />
    <p:SortValue Value=”crayon, pastel and ink on paper” />
    <p:SortValue Value=”etching on cream paper” />
    <p:SortValue Value=”etching on white paper” />
    <p:SortValue Value=”gouache and ink on paper” />
    <p:SortValue Value=”gouache and watercolor on paper” />
    <p:SortValue Value=”gouache, tempera and watercolor on paper on board” />
    <p:SortValue Value=”graphite and ink on paper” />
    <p:SortValue Value=”graphite on paper” />
    <p:SortValue Value=”ink and wash on paper” />
    <p:SortValue Value=”leather over wood” />
    <p:SortValue Value=”mixed media assemblage on cardboard and wood” />
    <p:SortValue Value=”mixed media collage” />
    <p:SortValue Value=”mixed media collage drawing” />
    <p:SortValue Value=”oil & collage on canvas” />
    <p:SortValue Value=”oil and collage on canvas” />
    <p:SortValue Value=”oil and fabric collage on canvas” />
    <p:SortValue Value=”oil and metallic paint on unprimed canvas” />
    <p:SortValue Value=”oil and pastel on paper” />
    <p:SortValue Value=”oil on canvas” />
    <p:SortValue Value=”oil on masonite” />
    <p:SortValue Value=”oil with collage on canvasboard” />
    <p:SortValue Value=”oil, collage and relief on canvas” />
    <p:SortValue Value=”oil, pastel and watercolor on paper” />
    <p:SortValue Value=”pen and ink on paper” />
    <p:SortValue Value=”sumi ink on paper” />
    <p:SortValue Value=”tempera and ink on paper” />
    <p:SortValue Value=”watercolor and goauche on paper” />
    <p:SortValue Value=”watercolor on paper” />
    </p:SortOrder>
    </Extension>
    </FacetCategory>
    <FacetCategory Name=”Artist” Type=”String” p:IsFilterVisible=”true” p:IsMetaDataVisible=”true” p:IsWordWheelVisible=”true”>
    <Extension>
    <p:SortOrder Name=”Artist”>
    <p:SortValue Value=”Benny Andrews” />
    <p:SortValue Value=”Dorothy Dehner” />
    <p:SortValue Value=”Eldzier Cortor” />
    <p:SortValue Value=”Morris Graves” />
    <p:SortValue Value=”Nancy Grossman” />
    <p:SortValue Value=”Norman Lewis” />

    </p:SortOrder>
    </Extension>
    </FacetCategory>
    <FacetCategory Name=”Decade” Type=”String” p:IsFilterVisible=”true” p:IsMetaDataVisible=”true” p:IsWordWheelVisible=”true”>
    <Extension>
    <p:SortOrder Name=”Decade”>
    <p:SortValue Value=”1940″ />
    <p:SortValue Value=”1950″ />
    <p:SortValue Value=”1960″ />
    <p:SortValue Value=”1970″ />
    <p:SortValue Value=”1980″ />
    <p:SortValue Value=”1990″ />
    </p:SortOrder>
    </Extension>
    </FacetCategory>
    <FacetCategory Name=”InventoryNo” Type=”String” p:IsFilterVisible=”false” p:IsMetaDataVisible=”false” p:IsWordWheelVisible=”true” />
    </FacetCategories>
    <Items ImgBase=”Kiosk1_deepzoom\Kiosk1.dzc”>
    <Item Id=”0″ Name=”Nancy Grossman” Img=”#0″ Href=”/”>
    <Description>Untitled</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Nancy Grossman” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1960″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”GROSSM0002″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”mixed media collage” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”1″ Name=”Morris Graves” Img=”#1″ Href=”/”>
    <Description>Waning Moon</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Morris Graves” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1940″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”GRAVES0006″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”gouache and watercolor on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”2″ Name=”Morris Graves” Img=”#2″ Href=”/”>
    <Description>A Slice of Fruit</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Morris Graves” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1970″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”GRAVES0008″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”tempera and ink on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”3″ Name=”Morris Graves” Img=”#3″ Href=”/”>
    <Description>Crane</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Morris Graves” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1940″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”GRAVES0010″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”sumi ink on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”4″ Name=”Norman Lewis” Img=”#4″ Href=”/”>
    <Description>Untitled</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Norman Lewis” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1940″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”LEWIS00015″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”black ink on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”5″ Name=”Norman Lewis” Img=”#5″ Href=”/”>
    <Description>Untitled</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Norman Lewis” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1950″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”LEWIS00018″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”black ink and wash on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”6″ Name=”Norman Lewis” Img=”#6″ Href=”/”>
    <Description>Untitled</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Norman Lewis” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1970″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”LEWIS00019″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”black ink and watercolor on paper” />
    </Facet>
    </Facets>
    </Item>
    <Item Id=”7″ Name=”Norman Lewis” Img=”#7″ Href=”/”>
    <Description>France-Terrace</Description>
    <Facets>
    <Facet Name=”Artist”>
    <String Value=”Norman Lewis” />
    </Facet>
    <Facet Name=”Decade”>
    <String Value=”1960″ />
    </Facet>
    <Facet Name=”InventoryNo”>
    <String Value=”LEWIS00020″ />
    </Facet>
    <Facet Name=”Media”>
    <String Value=”watercolor on paper” />
    </Facet>
    </Facets>
    </Item>
    </Items>
    </Collection>

     
  8. David T

    March 7, 2012 at 9:09 pm

    I too am trying to upgrade to Pivotviewer v2 and using this video to start from scratch. I’m trying to currently build the LoadCxmlCollection but the PivotFactory method is not there. I’m guessing I’m missing a library in the C# Silverlight project but I don’t know which.

    I have added the System.Windows.Controls.Pivot reference which is version 5.0.5.0 and it looks like yours is reference to System.Windows.Pivot, are there any differences?

    Sorry I’m now to C# programming and I’m trying to wrap my head around all of this stuff. Any help from anyone on how to get started would be appreciated.

    I have used this website
    http://www.jasonrshaver.com/post/2011/10/30/PivotViewer-V2-Series-Part-1-Intro.aspx
    To set up my environment but I can’t seem to get the PivotFactory method to load up for me.
    I do see in the reference I’m using 5.0.5.0 but the runtime is v4.0 is that an issue?

     
  9. pedro

    April 26, 2012 at 1:01 pm

    Hey DavidT, did you resolve your problem? I’m facing exactly the same problem in my project. Anyone came up with a solution?

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: