[Ironruby-core] Manipulating Silverlight controls dynamically from IronRuby - is it currently possible ?

Ivan Porto Carrero ivan at flanders.co.nz
Tue Apr 8 08:25:47 EDT 2008


Hi

Yes the button control is available. The code that goes with that blog post
uses a button. I want to improve that code still because you can do more
with IronRuby than that. I just need some time to do it.
http://flanders.co.nz/2008/04/06/an-ironruby-digg-client/

Basically you need to add the assemblies System.Windows.Controls and
System.Windows.Controls.Extended to your app folder. You can find those
assemblies in program files\microsoft sdks\Silverlight\v2.0
You also need to add a AppManifest.xaml file to your app folder and that
should contain:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
RuntimeVersion="2.0.30226.00"
EntryPointAssembly="Microsoft.Scripting.Silverlight"
EntryPointType="Microsoft.Scripting.Silverlight.DynamicApplication">
  <Deployment.Parts>
    <!-- Add additional assemblies here -->
    <AssemblyPart Name="Microsoft.Scripting.Silverlight"
Source="Microsoft.Scripting.Silverlight.dll" />
    <AssemblyPart Source="Microsoft.Scripting.dll" />
        <!-- Silverlight SDK controls assemblies -->
        <AssemblyPart Source="System.Windows.Controls.dll" />
        <AssemblyPart Source="System.Windows.Controls.Extended.dll" />
        <AssemblyPart Source="System.Xml.Linq.dll" />
        <AssemblyPart Source="IronRuby.dll" />
    <AssemblyPart Source="IronRuby.Libraries.dll" />

    </Deployment.Parts>
</Deployment>

from then on you can use the button control but you still need to add the
namespace to your xaml file. I have this for a button.
<UserControl x:Class="System.Windows.Controls.UserControl"
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:c="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"

xmlns:e="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Extended"
>
<Grid>
<e:WatermarkedTextBox x:Name="search_textbox"  Watermark="Topic..."
FontFamily="Trebuchet MS" Grid.Column="1" FontSize="12" Padding="1,3,1,1" />
<c:Button Content="Search" x:Name="search_button" Style="{StaticResource
SearchButton}" />
</Grid>

hth
Ivan


On Wed, Apr 9, 2008 at 12:16 AM, Thibaut Barrère <thibaut.barrere at gmail.com>
wrote:

> Hi,
>
> Is it currently possible to add children to an existing Silverlight
> control from the ruby code side ? (like in the IronPython version seen on
> http://www.voidspace.org.uk/ironpython/webide/webide.html - great stuff
> btw Michael!)
>
> And an extra question: is the Button control available from the
> silverlight build on http://dynamicsilverlight.net ?
>
> cheers,
>
> -- Thibaut
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080409/11c3a475/attachment.html 


More information about the Ironruby-core mailing list