Author: toshok
Date: 2007-07-20 22:42:40 -0400 (Fri, 20 Jul 2007)
New Revision: 82405
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/xaml.cpp
Log:
2007-07-20 Chris Toshok <[EMAIL PROTECTED]>
* xaml.cpp (custom_add_child): this method is what's called when
we add a child to an element of a custom namespace. Trouble is,
it might be a panel subclass. If it is, and the child is a
UIElement subclass, go ahead and add the child using
panel_child_add. This gets the Loaded events working properly in
the chess demo (the trouble was that the custom children weren't
even added to the tree, so their OnLoaded methods weren't being
called)
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-07-21 01:15:13 UTC (rev 82404)
+++ trunk/moon/src/ChangeLog 2007-07-21 02:42:40 UTC (rev 82405)
@@ -1,3 +1,14 @@
+2007-07-20 Chris Toshok <[EMAIL PROTECTED]>
+
+ * xaml.cpp (custom_add_child): this method is what's called when
+ we add a child to an element of a custom namespace. Trouble is,
+ it might be a panel subclass. If it is, and the child is a
+ UIElement subclass, go ahead and add the child using
+ panel_child_add. This gets the Loaded events working properly in
+ the chess demo (the trouble was that the custom children weren't
+ even added to the tree, so their OnLoaded methods weren't being
+ called)
+
2007-07-20 Miguel de Icaza <[EMAIL PROTECTED]>
* collection.cpp: Add support for RemoveAt.
Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp 2007-07-21 01:15:13 UTC (rev 82404)
+++ trunk/moon/src/xaml.cpp 2007-07-21 02:42:40 UTC (rev 82405)
@@ -62,7 +62,6 @@
void dependency_object_set_attributes (XamlParserInfo *p, XamlElementInstance
*item, const char **attr);
void parser_error (XamlParserInfo *p, const char *el, const char *attr, const
char *message);
-
XamlElementInstance *create_custom_element (XamlParserInfo *p, XamlElementInfo
*i);
void set_custom_attributes (XamlParserInfo *p, XamlElementInstance *item,
const char **attr);
void custom_add_child (XamlParserInfo *p, XamlElementInstance *parent,
XamlElementInstance *child);
@@ -340,15 +339,24 @@
void
set_custom_attributes (XamlParserInfo *p, XamlElementInstance *item, const
char **attr)
{
-
}
-void custom_add_child (XamlParserInfo *p, XamlElementInstance *parent,
XamlElementInstance *child)
+void
+custom_add_child (XamlParserInfo *p, XamlElementInstance *parent,
XamlElementInstance *child)
{
+ // XXX do we need to do anything here?
+
+ // if it's not handled, we definitely need to at least check if the
+ // object is a panel subclass, and if so add it as we would a normal
+ // child.
+ if (parent->item->Is (Type::PANEL) && child->item->Is
(Type::UIELEMENT)) {
+ panel_child_add ((Panel *) parent->item, (UIElement *)
child->item);
+ }
}
-void custom_set_property (XamlParserInfo *p, XamlElementInstance *item,
XamlElementInstance *property, XamlElementInstance *value)
+void
+custom_set_property (XamlParserInfo *p, XamlElementInstance *item,
XamlElementInstance *property, XamlElementInstance *value)
{
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches