Author: rolf
Date: 2007-10-09 17:01:49 -0400 (Tue, 09 Oct 2007)
New Revision: 87223

Modified:
   trunk/moon/gtk/ChangeLog
   trunk/moon/gtk/gtk.cs
Log:
2007-10-09  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * gtk.cs: Use the XamlLoader in agclr.



Modified: trunk/moon/gtk/ChangeLog
===================================================================
--- trunk/moon/gtk/ChangeLog    2007-10-09 20:55:02 UTC (rev 87222)
+++ trunk/moon/gtk/ChangeLog    2007-10-09 21:01:49 UTC (rev 87223)
@@ -1,3 +1,7 @@
+2007-10-09  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * gtk.cs: Use the XamlLoader in agclr.
+
 2007-10-08  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
 
        * gtk.cs: Use platform invokes in agmono instead of declaring them

Modified: trunk/moon/gtk/gtk.cs
===================================================================
--- trunk/moon/gtk/gtk.cs       2007-10-09 20:55:02 UTC (rev 87222)
+++ trunk/moon/gtk/gtk.cs       2007-10-09 21:01:49 UTC (rev 87223)
@@ -187,27 +187,18 @@
                canvas = null;
 
                if (xaml == null)
-                       throw new ArgumentNullException ("file");
+                       throw new ArgumentNullException ("xaml");
 
-               Mono.Kind k;
-       
-               IntPtr loader = NativeMethods.xaml_loader_new (null, xaml, 
surface);
-               IntPtr x = NativeMethods.xaml_create_from_str (loader, xaml, 
true, out k);
-               NativeMethods.xaml_loader_free (loader);
+               DependencyObject dob = XamlReader.Load (xaml, true);
 
-               if (x == IntPtr.Zero)
+               if (dob == null)
                        return false;
 
-               // TODO: Check that x is a Canvas
-
-               MethodInfo m = typeof (Canvas).GetMethod ("FromPtr", 
BindingFlags.Static | BindingFlags.NonPublic);
-               Canvas c = (Canvas) m.Invoke (null, new object [] { x });
-               if (c == null)
+               canvas = dob as Canvas;
+               if (canvas == null)
                        return false;
        
-               Attach (c);
-       
-               canvas = c;
+               Attach (canvas);
 
                return true;
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to