<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-2"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Lukas,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>When you use ExtensionPart, it calls Assembly.Load on each file in the zip file referenced, so you don’t need to do clr.Addreference.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>System.Windows.Data.dll and System.Windows.Controls.Data.dll are not DLLs in Silverlight; they are in the Silverlight SDK. So you’ll have to package them up into a separate zip file which you include in your AppManfest, just like you did with the SLToolkit.zip.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>~js<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] <b>On Behalf Of </b>Lukas Cenovsky<br><b>Sent:</b> Tuesday, March 23, 2010 5:42 PM<br><b>To:</b> users@lists.ironpython.com<br><b>Subject:</b> [IronPython] AddReference to Silverlight toolkit assemblies<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi all,<br>I use Silverlight toolkit in my IronPython Silverlight app. To lower bandwidth, I put all necessary Silverlight toolkit .dlls into separate file called <i>SLToolkit.zip</i> which I reference in AppManifest.xaml:<br><br><tt><span style='font-size:10.0pt'> <Deployment.ExternalParts></span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt> <ExtensionPart Source="Microsoft.Scripting.zip" /></tt><br><tt> <ExtensionPart Source="SLToolkit.zip" /></tt><br><tt> </Deployment.ExternalParts></tt></span><br><br>This works nicely if I don't need to reference assembly already existing in Silverlight - e.g. I do<br><br><tt><span style='font-size:10.0pt'>clr.AddReference('System.Windows.Controls.Data')</span></tt><br><br>and use <i>DataGrid</i>. Unfortunately, when I need to reference <i>PagedCollectionView </i>from System.Windows.Data, this approach does not work. Trying <br><br><tt><span style='font-size:10.0pt'>from System.Windows.Data import PagedCollectionView</span></tt><br><br>fails on <i>ImportError: Cannot import name PagedCollectionView</i>. Doing <br><br><tt><span style='font-size:10.0pt'>import System.Windows.Data</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>System.Windows.Data.PagedCollectionView(some_data)</tt></span><br><br>fails with <i>AttributeError: attribute 'PagedCollectionView' of 'namespace#' object is read-only</i>. When I try to add<br><br><tt><span style='font-size:10.0pt'>clr.AddReference('System.Windows.Data')</span></tt><br><br>if fails with: <i>IOError: [Errno 2] could not find assembly: System.Windows.Data (check the Web server)</i>.<br><br>The only way how to make this work is to put <tt><span style='font-size:10.0pt'>System.Windows.Data.dll</span></tt> into .xap file and reference it with<br><br><tt><span style='font-size:10.0pt'>clr.AddReferenceToFile('System.Windows.Data.dll')</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>from System.Windows.Data import PagedCollectionView</tt></span><br><br><br>Is there a way to make it work when <tt><span style='font-size:10.0pt'>System.Windows.Data.dll</span></tt> is in the separate file? Or should I use another approach?<br><br>Thanks, <br><br>--<br>-- Lukáš<o:p></o:p></p></div></body></html>