Silverlight doesn&#39;t support ICustomTypeDescriptor -- that&#39;s probably why binding is failing. You need to emit CLR properties to use data binding with Silverlight 2 and 3.<br><br>
<div class="gmail_quote">2009/11/12 Shri Borde <span dir="ltr">&lt;<a href="mailto:Shri.Borde@microsoft.com">Shri.Borde@microsoft.com</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div lang="EN-US" vlink="purple" link="blue" bgcolor="white">
<div>
<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">So the new clrtype.py still works - cool!</span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">&nbsp;</span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">I am not an expert on data binding, so I don&rsquo;t have any suggestions. Why do you say that the decorator approach will not work with Silverlight? Does @notifiy_property from <a href="http://gui-at.blogspot.com/2009/11/inotifypropertychanged-in-ironpython.html" target="_blank">http://gui-at.blogspot.com/2009/11/inotifypropertychanged-in-ironpython.html</a> use any feature not available in Silverlight?</span></p>

<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">&nbsp;</span></p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p class="MsoNormal"><b><span style="COLOR: windowtext; FONT-SIZE: 10pt">From:</span></b><span style="COLOR: windowtext; FONT-SIZE: 10pt"> Lukas Cenovsky [mailto:<a href="mailto:cenovsky@bakalari.cz" target="_blank">cenovsky@bakalari.cz</a>] <br>
<b>Sent:</b> Thursday, November 12, 2009 8:09 AM<br><b>To:</b> Shri Borde<br><b>Subject:</b> Re: [IronPython] .NET attributes for methods</span></p></div></div>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Thanks, that works!<br><br>What do you think would be the best approach to create notifiable properties for Silverlight? I did it for WPF (via decorators: <a href="http://gui-at.blogspot.com/2009/11/inotifypropertychanged-in-ironpython.html" target="_blank">http://gui-at.blogspot.com/2009/11/inotifypropertychanged-in-ironpython.html</a>) but it seems to me it won&#39;t be possible to do it similarly for Silverlight...<br>
<br>--<br>-- Lukáš<br><br>Shri Borde wrote: </p>
<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">Can you use &ldquo;_clrproperties&rdquo; instead of &ldquo;_clrfields&rdquo;? DevHawk&rsquo;s same created a field and a property even when you just used &ldquo;_clrfields&rdquo;. I don&rsquo;t do that anymore. So you will need to use &ldquo;_clrproperties&rdquo; to get properties, which SL must use for data binding.</span></p>

<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">&nbsp;</span></p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p class="MsoNormal"><b><span style="COLOR: windowtext; FONT-SIZE: 10pt">From:</span></b><span style="COLOR: windowtext; FONT-SIZE: 10pt"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">mailto:users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Lukas Cenovsky<br>
<b>Sent:</b> Wednesday, November 11, 2009 2:37 AM<br><b>To:</b> Discussion of IronPython<br><b>Subject:</b> Re: [IronPython] .NET attributes for methods</span></p></div></div>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I did change __metaclass__ to ClrMetaclass. See the attached source I use for testing - the only difference is to comment/uncomment appropriate part in product.py.<br><br>The outputs look the same, there are no visible exceptions:<br>
<br>DevHawk:</p><pre><span>py&gt; </span>a.root.FindName(&#39;listbox1&#39;).ItemsSource[0].GetType().GetFields()</pre>
<div><pre>=&gt;&nbsp;Array[FieldInfo]((&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002B&nbsp;[Double&nbsp;cost]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002C&nbsp;[Int32&nbsp;quantity]&gt;,</pre><pre>
&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002D&nbsp;[System.String&nbsp;name]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002E&nbsp;[IronPython.Runtime.Types.PythonType&nbsp;.class]&gt;,</pre><pre>
&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002F&nbsp;[IronPython.Runtime.PythonDictionary&nbsp;.dict]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x0000000000000030&nbsp;[System.Object[]&nbsp;.slots_and_weakref]&gt;))</pre>
</div>
<p class="MsoNormal"><br>Shri:</p><pre><span>py&gt; </span>a.root.FindName(&#39;listbox1&#39;).ItemsSource[0].GetType().GetFields()</pre>
<div><pre>=&gt;&nbsp;Array[FieldInfo]((&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002B&nbsp;[Double&nbsp;cost]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002C&nbsp;[Int32&nbsp;quantity]&gt;,</pre><pre>
&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002D&nbsp;[System.String&nbsp;name]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002E&nbsp;[IronPython.Runtime.Types.PythonType&nbsp;.class]&gt;,</pre><pre>
&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x000000000000002F&nbsp;[IronPython.Runtime.PythonDictionary&nbsp;.dict]&gt;,</pre><pre>&lt;System.Reflection.RtFieldInfo&nbsp;object&nbsp;at&nbsp;0x0000000000000030&nbsp;[System.Object[]&nbsp;.slots_and_weakref]&gt;))</pre>

<p class="MsoNormal">&nbsp;</p></div>
<p class="MsoNormal">--<br>-- Lukáš<br><br><br>Shri Borde wrote: </p>
<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">Note that you will have to set __metaclass__ to ClrMetaclass, not ClrTypeMetaclass as in DevHawk&rsquo;s sample. I had changed the name of the type. The old name will cause a NameError, but maybe SL is hiding exceptions. Can you do &ldquo;o.GetType().GetFields()&rdquo; and display that on the page to inspect the object and also make sure that no exceptions were thrown?</span></p>

<p class="MsoNormal"><span style="COLOR: #1f497d; FONT-SIZE: 11pt">&nbsp;</span></p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p class="MsoNormal"><b><span style="COLOR: windowtext; FONT-SIZE: 10pt">From:</span></b><span style="COLOR: windowtext; FONT-SIZE: 10pt"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">mailto:users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Lukas Cenovsky<br>
<b>Sent:</b> Tuesday, November 10, 2009 2:59 PM<br><b>To:</b> Discussion of IronPython<br><b>Subject:</b> Re: [IronPython] .NET attributes for methods</span></p></div></div>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I have just found that the Silverlight binding does not work with this version of clrtype and/or IronPython 2.6RC2.<br>I used DevHawk demo [1] and after I added reference to Microsoft.Dynamic in clrtypemetaclass.py it worked flawlessly. But when I switch to your version, no items show in the listbox.<br>
<br>By the way - I have seen a commit message you have added support for interfaces - nice! ;-)<br><br>--<br>-- Lukáš<br><br>[1] <a href="http://cid-0d9bc809858885a4.skydrive.live.com/self.aspx/DevHawk%20Content/IronPython%20Stuff/%5E_%5E_clrtype%5E_%5E_/SL%20databinding%20demo.zip" target="_blank">http://cid-0d9bc809858885a4.skydrive.live.com/self.aspx/DevHawk%20Content/IronPython%20Stuff/^_^_clrtype^_^_/SL%20databinding%20demo.zip</a></p>

<p class="MsoNormal">&nbsp;</p></div></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>