10 Minute Tutorial - Silverlight: Building a Silverlight application with MSBuild (C#)
“If you build it they will come”
Don’t know about that, but if you use MSBuild, it’ll sure make everyone’s life a hell of alot easier.
As of .NET 2.0, Microsoft provides developers with a build engine, called MSBuild, as part of the runtime distribution. In this tutorial, I will walk through hand-coding a MSBuild build file for the sample code of my application framework Silverlight tutorial. Read more
10 Minute Tutorial - JavaFX: Event handling using trigger and bind
Update:
This tutorial will NOT work on the recently released JavaFX Preview SDK. In the move from JavaFX Script to compiled JavaFX code, much of the language and libraries have changed. Since the language and APIs continue to change at a rapid rate, I will not update this tutorial until they have stabled a bit more. If you want to see some JavaFX code that works under the JavaFX Preview SDK, you can read my JavaFX Hello World tutorial, and also look at these sites:
- James Weaver’s JavaFX Blog (contains many tutorials and sample code using the latest JavaFX build)
- OpenJFX Home (has the latest news on JavaFX)
- JavaFX Script Programming Language Migration Guide (a guide that details how to migrate JavaFX Script, like the code in this tutorial, to compiled JavaFX)
- JavaFX API doc (the latest documentation for JavaFX from the nightly builds)
Feel free to read on….
Clearly, the creators of JavaFX Script want to make it a great MVC programming language. Nothing says this more than baking triggers and binding into the language as first class concepts. According to the documentation, JavaFX triggers operate in the same manner as SQL triggers, allowing you to handle data modification events in an aspect-like fashion. And, the bind keyword allows bidirectional binding between two variables so that when one receives an update the other also gets updated. Using these concepts, its easy to remove some of the tedium in handling modification events of UI elements and variables that other languages and frameworks require developers to slog through. Read more
10 Minute Tutorial - Silverlight: Using JavaScript to Call Scriptable Managed Code (C#)
My event handling tutorial walked through manipulating a Silverlight control using managed code. Today, we will learn how to access that managed code from JavaScript in an HTML page. The blandness of my last tutorial (a blue rectangle, whoopie) inspired me to spice things up for this tutorial and give you: animated, multi-color rectangles! Lacking the desire or the time to create the necessary XAML myself, I “borrowed” it from one of the samples embedded in the absolutely awesome SilverlightPad application.
Man, I hope that code is open source.
In addition to snazzy animations, the application for this tutorial will also contain a couple of form controls that will manipulate the Silverlight content at runtime. The first control, a simple drop down, will allow the user to select the number of rectangles displayed on the screen. The second form control will act as a pause/resume button for the animation.
Okay, let’s get started! Read more
10 Minute Tutorial - JavaFX: Hello World
Over the past couple of months, I wrote a number of Microsoft Silverlight tutorials both to learn Silverlight and help other developers ramp up their Silverlight skills quickly. Now however, I’ll turn my attention to one of Silverlight’s competitors: JavaFX. If you read the JavaFX section of my introductory post, you already know that Sun has taken a very different approach than Microsoft in implementing a framework for developing easily deployed, highly-interactive, “rich” applications. So, I want to jump right in and create an application that will have everyone hanging on the edge of their seat with enthusiasm (or rolling their eyes and groaning in almost physical pain): Hello World. Read more
10 Minute Tutorial - Silverlight: Event handling using Managed Code (C#)
Managed code.
In the browser.
All my dreams have come true.
Well, not quite. Catherine Zeta-Jones and Lucy Liu still haven’t returned my calls. But, it’s a start!
I wrote this tutorial to illustrate how Silverlight communicates with managed code. So, as a simple example, we’ll use C# to handle click events inside of a rectangle rendered on a Silverlight control. And, like always, you can complete this tutorial sans-IDE, for those users who don’t want to install Visual Studio just to get a taste of Silverlight. Read more