Boo and WPF

Here is an example of Boo and WPF.
I am not claiming that it is origonal since it was cribbed from someone elses site.
However this version is not broken and does have a build script.

The following is

namespace Boo.WinFx
import System
import System.Windows
import System.Windows.Controls
import System.Windows.Navigation

def Main():
    # create a window host
    win = NavigationWindow()   
    # create a textblock
    para = TextBlock(Text:”Hello World!!!”, FontSize:36)
    para.VerticalAlignment = VerticalAlignment.Center
    para.HorizontalAlignment =HorizontalAlignment.Center   
    # create a button
    button = Button(Content:”Click Me”, Height:30, Width:100)
    # display the textblock when the button is clicked
    button.Click += { win.Navigate(para) }
    # display the button first
    # create an application host
    app = Application()
    # show the window
    # fire the application

The following is

<?xml version=”1.0″ ?>

<project name=”wpfdemo” default=”build”>
<property name=”boo.dir” value=”C:/boo/bin” />
    <target name=”build” depends=”wpfdemo” />
    <target name=”wpfdemo”>
        <loadtasks assembly=”${boo.dir}/Boo.NAnt.Tasks.dll” />
                 <booc output=”wpfdemo.exe” target=”winexe”>
                <include name=”C:/Program Files/Reference Assemblies/Microsoft/Framework/v3.0/*.dll” />
                <include name=”” />

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s