Nemerle

A quick look at one of the more advanced .net functional languages.

38bafce9d65f

Unfortunately it lacks Visual Studio Express support 😦

The problem is: how to start a XAML window?

My solution below


using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Resources;
using System.Xml;
using System.Windows.Markup;
using System.Console;

namespace NemerleSpace
{


public module Launcher {
	[STAThread]
	public static Main() : void {
		try {

			Console.WriteLine("Start!");

			def myApp = Application();

			def XmlRead = XmlReader.Create("MainWindow.xaml");

			def mainW = XamlReader.Load(XmlRead) :> Window;
			_ = myApp.Run(mainW);
		}
		catch {
			| e is XamlParseException => {
				Console.WriteLine("Exception!");
				Console.WriteLine(e.Message);
				Console.WriteLine(e.StackTrace);
			} 
		}

	}
}


}

Compiled with the following command line:

"C:\Program Files (x86)\Nemerle\net-4.0\ncc.exe" Launch.n -r System.Windows -r System.Xaml -r System.Core -r WindowsBase -r PresentationCore -r PresentationFramework -o Launch.exe
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s