Using ItemCollection

Oct 30, 2012 at 8:54 PM

Instead of having a list of objects, I have a container object (Activities) that has a ItemCollection based on IEnumerable<Object that holds the (Activity) objects. I instantiate "Activities" like CurrentActivities, PossibleActivites.  I try to replicate/modify the example SaveAndLoadListOfPocos like this

  public async Task SaveRealActivities()
        {
           var osh = new ObjectStorageHelper>(StorageType.Local);
            await osh.SaveAsync(_realActiv.Collection);

        }

I get a build error.  It certainly doesn't like the way I'm coding it.

 

Coordinator
Oct 30, 2012 at 9:24 PM

Hi Steve,

Hmmm...thanks for letting me know. What's the error that you receive?

 

regards
Jamie

Oct 31, 2012 at 1:23 AM

Jamie…Thanks for the reply.

I don’t know if the error code is all that relevant. It depends on which incorrect code I try J I think it boils down to the my ItemCollection isn’t look at as a List of T. I actually get an error in constructing ObjectStorageHelper.

var osh = new ObjectStorageHelper<List<RealActiv>>(StorageType.Local);

RealActiv is my class that contains the ItemCollection

I’ve tried all kinds of things….I’m even currently messing around with _realActiv.Collection.OfType<RealActiv>().ToList()

Any advice…greatly appreciated.

Thanks


Steve

From: jamiet [email removed]
Sent: Tuesday, October 30, 2012 4:25 PM
To: stevearas@comcast.net
Subject: Re: Using ItemCollection [winrtstoragehelper:401292]

From: jamiet

Hi Steve,

Hmmm...thanks for letting me know. What's the error that you receive?

regards
Jamie