c# - Custom Jump lists in Windows Phone -
i have been looking @ this: http://code.msdn.microsoft.com/wpapps/custom-longlist-selector-bf8cb9ad , trying incorporate app. however, little confusing since info loaded differently. right now, have 2 errors best overloaded method match customkeygroup<.viewmodels.sounddata>.getsoundgroups(system.collections.generic.list<.viewmodels.sounddata>)' has invalid arguments
argument 1: cannot convert 'string' 'system.collections.generic.list'
the error @ 'customkeygroup.getsoundgroups(mvm.items);' mainpage.cs. know items issue. if @ link, load info differently w/ listmovie.add.
i know screwed big time since info loaded different, im struggling working correctly.
id have custom jumplist w/ headers groups (alpha, bravo, etc) located in soundmodel. here portion:
namespace t.viewmodels { public class soundmodel: bindablebase { public soundgroup newadds { get; set; } public soundgroup software { get; set; } } public bool isdataloaded { get; set; } public void loaddata() { // load info model software = createsoftwaregroup(); newadds = createnewaddsgroup(); isdataloaded = true; } private soundgroup createnewaddsgroup() { soundgroup info = new soundgroup(); data.title = "new"; string basepath = "assets/audio/newadds/"; data.items.add(new sounddata { title = "test1", filepath = basepath + "test.mp3", groups = "alpha" }); data.items.add(new sounddata { title = "test2", filepath = basepath + "test2.mp3", groups="bravo" }); data.items.add(new sounddata { title = "test3", filepath = basepath + "test3.mp3", groups= "zulu" }); private soundgroup createsoftwaregroup() { soundgroup info = new soundgroup(); data.title = "software"; string basepath = "assets/audio/software/"; data.items.add(new sounddata { title = "test1", filepath = basepath + "test.mp3", groups = "alpha" }); data.items.add(new sounddata { title = "test2", filepath = basepath + "test2.mp3", groups="bravo" }); data.items.add(new sounddata { title = "test3", filepath = basepath + "test3.mp3", groups= "zulu" });
here relevant mainpage.cs:
sounddata mvm = new sounddata(); this.longlist.itemssource = customkeygroup<sounddata>.getsoundgroups(mvm.items);
soundgroup:
{ public class soundgroup { public soundgroup() { items = new list<sounddata>(); } public list<sounddata> items { get; set; } public string title { get; set; } public string groups { get; set; } } }
sounddata :
{ public class sounddata : viewmodelbase { public string title { get; set; } public string filepath { get; set; } public string items { get; set; } public string groups { get; set; } public relaycommand<string> savesoundasringtone { get; set; } private void executesavesoundasringtone(string soundpath) { app.current.rootvisual.dispatcher.begininvoke(() => { saveringtonetask task = new saveringtonetask(); task.source = new uri("appdata:/" + this.filepath); task.displayname = this.title; task.show(); } ); } public sounddata() { savesoundasringtone = new relaycommand<string>(executesavesoundasringtone); } } }
so far can see should calling function below
soundmodel svm = new soundmodel(); svm.loaddata(); this.longlist.itemssource = customkeygroup<sounddata>.getsoundgroups(svm.software.items);
or
this.longlist.itemssource = customkeygroup<sounddata>.getsoundgroups(svm.newadds.items);
the reason need pass generic.list<.viewmodels.sounddata>
in method getsoundgroups
, list contained in soundgroup
class. since info loaded within soundmodel
class think of above implementation only.
c# windows-phone-8 jump-list
No comments:
Post a Comment