Skip to content

Instantly share code, notes, and snippets.

@YutaWatanabe
Created September 3, 2014 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YutaWatanabe/8134d361a9c5b1779163 to your computer and use it in GitHub Desktop.
Save YutaWatanabe/8134d361a9c5b1779163 to your computer and use it in GitHub Desktop.
LINQ to XML with Monotouch.Dialog
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
//XMLファイルを読み込み
var doc = XDocument.Load ("SessionData.xml");
// LINQ to XML & Monotouch.Dialog
var _rootElement = new RootElement ("de:code") {
from x in doc.Descendants("Sess ion")
group x by x.Element("Track").Value into agroup
select new Section (agroup.Key) {
from y in agroup
select (Element) new BadgeElement(new UIImage("images/" + y.Element("Image").Value), y.Element("Name").Value,
delegate {
new UIAlertView ("概要", y.Element("Description").Value, null, "OK", null).Show();
})
}
};
var rootVC = new DialogViewController (_rootElement);
nav = new UINavigationController (rootVC);
window.RootViewController = nav;
window.MakeKeyAndVisible ();
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment