Time to continue with WPF.
You don't need to use XAML to program WPF. Quite the contrary. Everything you can do with XAML you can do with C#. It's just a matter of using the right tool for the right job. It doesn't make much sense to do all the layout code in C#, XAML will hopefully do a better job there. Anyway, just to prove the point I have to start where every new technology starts: Hello World!
I've installed all the necessary tools. I've started VS2005 and created a new WinFx application.The application by default holds references to all relevant assemblies, these being:- PresentationCode- PresentationFramework- ReachFramework- UIAutomationProvider- UIAutomationTypes- WindowsBase
The names of these assemblies don't look very RTM-like, so I have to assume they'll change in one of the upcoming CTP's or RTM.
I like to start as clean as possible, so I throw out all the stuff under the properties folder and also the default created MyApp.xaml and Class1.xaml.
Now add a new class called HelloWorld:
using System;using System.Windows; //This is the WPF namespace namespace HelloWorld{ public class HelloWorld { [STAThread] public static void Main() { // This is the System.Windows.MessageBox MessageBox.Show("Hello SDN!"); } }}
namespace HelloWorld{ public class HelloWorld { [STAThread] public static void Main() { // This is the System.Windows.MessageBox MessageBox.Show("Hello SDN!"); }
}}
Startup the application and go!