src/FingersDance.Control.Menu/UserControlMenu.xaml.cs
changeset 59 1043e7c13ffc
parent 54 c724ac229181
child 62 cbe5b01679a3
--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Tue Sep 15 15:40:40 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Tue Sep 15 16:09:45 2009 +0200
@@ -10,6 +10,7 @@
 using Microsoft.Surface;
 using Microsoft.Surface.Presentation;
 using System.Xml.Serialization;
+using System.Reflection;
 
 namespace FingersDance.Control.Menu
 {
@@ -27,7 +28,16 @@
          private void initChildSize()
         {
             StreamReader reader = null;
-            reader = new StreamReader("../../Menu.iri");
+            FileInfo assemblyPath = new FileInfo(Assembly.GetExecutingAssembly().Location);
+            DirectoryInfo info = assemblyPath.Directory;
+            try
+            {
+                reader = new StreamReader(info.FullName.ToString() + "\\Resources\\menu.xml");
+            }
+            catch (Exception e)
+            {
+                // do nothing
+            }
             XmlSerializer serializer = new XmlSerializer(typeof(Menu));
             Menu temp = (Menu)serializer.Deserialize(reader);
             foreach (Item elt in temp.Items)