Created
September 3, 2014 13:51
-
-
Save YutaWatanabe/8134d361a9c5b1779163 to your computer and use it in GitHub Desktop.
LINQ to XML with Monotouch.Dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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