# Using custom controls with gestalt

**URL:** <https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214>\
**Category:** IronRuby\
**Created:** [January 25, 2010, 9:25am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214 "2010-01-25T09:25:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mroths](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mroths](https://www.ruby-forum.com/u/mroths)\
**Post date:** [January 25, 2010, 9:25am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214/1 "2010-01-25T09:25:22Z")

</div>

I’m preparing some demos of using silverlight+ironruby with gestalt.

It’s really impressive but i’d like to show an example using the bing  
map control but can’t work out how to make external controls  
available.

Here’s what I thought I should do:

- Created a Microsoft.Maps.slvx containing the  
Microsoft.Maps.MapControl.dll and Microsoft.Maps.MapControl.Common.dll
- Cracked open the dlr.xap file and added to the manifest and packaged it up  
again

The browser had cached dlr.xap which confused me for a while but I can  
now see the Microsoft.Maps.slvx is getting downloaded (i’m using my  
own little webserver tool - [http://bitbucket.org/markryall/webshare/](http://bitbucket.org/markryall/webshare/))  
but none of the classes seem to be available.

Can anyone see what’s missing?

I’d also like to demo using silverlight 4 - does anyone know if  
changes are required to the gestalt dlr.js, dlr.xap etc. to use the  
new features (camera control etc.)?

Mark.

---

<div class="post-metadata">

**Author:** ![mroths](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mroths](https://www.ruby-forum.com/u/mroths)\
**Post date:** [January 26, 2010, 4:12am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214/2 "2010-01-26T04:12:55Z")

</div>

In case anyone is curious - I got this to work by putting the  
Microsoft.Maps.MapControl.dll and Microsoft.Maps.MapControl.Common.dll  
assemblies directly into the DLR.xap file.

This doesn’t seem ideal - the slvx approach ensures that silverlight  
applications can avoid downloading command dependencies such as  
IronRuby, IronPython etc. once for every application.

It’s functional enough to show how easily silverlight applications can  
be created without needing an ide or a compiler.

Mark.

---

<div class="post-metadata">

**Author:** ![mroths](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mroths](https://www.ruby-forum.com/u/mroths)\
**Post date:** [January 26, 2010, 6:47am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214/3 "2010-01-26T06:47:26Z")

</div>

Mark,

Putting the dlls in the XAP is one way to do it. You could also put them  
into a ZIP file, and in your app download the zip file and use  
Silverlight’s Application.GetResourceStream API to extract the DLLs from  
the file, and call Assembly.Load on them. However, this is a bit  
annoying, so we support doing this:

This lets you put files in a zip, and then access them like they were  
part of the “filesystem”. However, I just tried this and I found a bug,  
so I’ll check in a fix and let you know when it’s fixed.

~Jimmy

---

<div class="post-metadata">

**Author:** ![mroths](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mroths](https://www.ruby-forum.com/u/mroths)\
**Post date:** [January 26, 2010, 11:35am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214/4 "2010-01-26T11:35:59Z")

</div>

Thanks.

That’s excellent - I can easily load gems that way too I guess (adding  
foo.zip to the load path).

I got the impression from the “sl back to just text” document that  
loading zips wasn’t implemented yet - should’ve just given it a try.

Gestalt does seem really awesome - providing textmate bundles is a nice  
touch.

On Tue, Jan 26, 2010 at 4:32 PM, Jimmy S.

---

<div class="post-metadata">

**Author:** ![mroths](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mroths](https://www.ruby-forum.com/u/mroths)\
**Post date:** [August 1, 2010, 9:06am UTC](https://www.ruby-forum.com/t/using-custom-controls-with-gestalt/182214/5 "2010-08-01T09:06:57Z")

</div>

Jimmy,

Did you ever get this fixed? I tried application/zip as well as  
application/x-zip-compressed, but in every case I get a “No such file to  
load” error.

Here’s the source:

Ryan R.

Email: removed\_email\_address@domain.invalid  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Twitter: @panesofglass  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Website: [http://panesofglass.org/](http://panesofglass.org/)

On Mon, Jan 25, 2010 at 10:32 PM, Jimmy S. \<
