Thanks. It works for me know. I don't remember exactly what I did wrong but probably I forgot to pack System.Windows.Controls.dll form SL SDK into SLToolkit.zip and it is probably referenced from System.Windows.Controls.Data.dll .

--
-- Lukáš


Jimmy Schementi wrote:

Lukas,

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.

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.

~js

*From:* users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Lukas Cenovsky
*Sent:* Tuesday, March 23, 2010 5:42 PM
*To:* users@lists.ironpython.com
*Subject:* [IronPython] AddReference to Silverlight toolkit assemblies

Hi all,
I use Silverlight toolkit in my IronPython Silverlight app. To lower bandwidth, I put all necessary Silverlight toolkit .dlls into separate file called /SLToolkit.zip/ which I reference in AppManifest.xaml:

  <Deployment.ExternalParts>
    <ExtensionPart Source="Microsoft.Scripting.zip" />
    <ExtensionPart Source="SLToolkit.zip" />
  </Deployment.ExternalParts>

This works nicely if I don't need to reference assembly already existing in Silverlight - e.g. I do

clr.AddReference('System.Windows.Controls.Data')

and use /DataGrid/. Unfortunately, when I need to reference /PagedCollectionView /from System.Windows.Data, this approach does not work. Trying

from System.Windows.Data import PagedCollectionView

fails on /ImportError: Cannot import name PagedCollectionView/. Doing

import System.Windows.Data
System.Windows.Data.PagedCollectionView(some_data)

fails with /AttributeError: attribute 'PagedCollectionView' of 'namespace#' object is read-only/. When I try to add

clr.AddReference('System.Windows.Data')

if fails with: /IOError: [Errno 2] could not find assembly: System.Windows.Data (check the Web server)/.

The only way how to make this work is to put System.Windows.Data.dll into .xap file and reference it with

clr.AddReferenceToFile('System.Windows.Data.dll')
from System.Windows.Data import PagedCollectionView


Is there a way to make it work when System.Windows.Data.dll is in the separate file? Or should I use another approach?

Thanks,

--
-- Lukáš

------------------------------------------------------------------------

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to