This is the ‘Hello world’ sample for Silverlight but it would work as well in WPF. If you haven’t download the S# runtime, fetch it from here.

  • Start a Silverlight application. A website is optional, it works with a testpage as well.
  • Add a reference to the Orbifold.SSharp assembly
  • In the Apps.xaml.cs add in the constructor an initialization of the runtime before the InitializeComponent() like this
public App()
{
    this.Startup += this.Application_Startup;
    this.Exit += this.Application_Exit;
    this.UnhandledException += this.Application_UnhandledException;
    RuntimeHost.Initialize();   
    InitializeComponent();
}
  • Add a button to the surface and attach a click event
  • In the click handler add the following bits
string code = @"MessageBox.Show(""Hello world!"");";
Script s = Script.Compile(code);
s.Execute();

That’s it, from here on the world is yours!