Skip to main content
/_layouts/images/titlegraphic.gif

Peter Himschoot's Windows Foundation Trilogy

Go Search
Peter Himschoot's Windows Foundation Trilogy
U2U Website
  

Talking about .NET, Windows Presentation Foundation, Workflow Foundation and Communication Foundation

 Image Web Part

Peter at U2U booth during TechEd Eur 2006
  U2U Home
  U2U Course Calendar
Talking about .NET, Windows Presentation Foundation, Workflow Foundation and Communication Foundation
The Future of C# (4.0) is awesome

I just attended Anders’ session on what is new in C# 4.0, and I must say, I went in a critic, and came out an enthusiast. Big theme is to be more like VB.NET, such as optional and named parameters, and dynamic invocation of methods.

There are 4 new things in C# 4.0.

Dynamic language features
Optional and named parameters
Better COM-interop
Co-variance

 

Dynamic language features

C# will now have a new keyword called dynamic. With it you can declare a variable, which comes down to the same type as object, but now with dynamic syntax. In C# 3.0 if you have an object reference you need to use reflection to call methods, with C#4.0 you can call any method you know exists on the object.

This is great when using for example Silverlight, because now you can call Javascript code from C# with normal syntax, instead of having to use Invoke. Awesome!!!

Optional and named parameters

Now methods can have optional and named parameters (like VB.NET). Not much to say about that, except for the next bit.

Com-Interop

Talking to COM objects have always been painful. C# 4.0 should make that a lot easier with dynamic invocatioons and optional parameters.

Co-Variance

You can assign an object reference a string object, but you cannot assign reference to a collections of objects a collection of strings. With C# we can now specify whether or not we’ll allow this. So some of the collections and interfaces will now use this syntax and enable some legal scenario’s which are not permitted in C# 3.0.

Don’t use Name as a Property for your own classes in Silverlight 2

Lately I discovered a change in Silverlight 2 (from beta 2) in the handling of names in XAML. If you create an object with a Name property, you cannot set it in XAML (not normally that is).

For example, you have this class:

public class Person
{
  public string Name { get; set; }

  public int Age { get; set; }
}

If you use it in XAML like this the Name property doesn’t get set:

<my:Person
           Name="jefke"
           Age="23">
</my:Person>

Instead XAML will create a reference called jefke pointing to this object.

This sucks of course because there are tons of objects out there that have a Name property, and now we cannot use them in XAML. This is also different from WPF, because there you can use a Name property, and use x:Name to set its namescope. The Name property will still get set normally; to make Name equivalent to x:Name you would use the RuntimeNamePropertyAttribute.

MessageBox in Silverlight?

Yes, you can. I just discovered that Silverlight RTM has a MessageBox class!

For example:

image

with as code behind

image

will show as

image

Nice.

XAML Power Toys

Tired of typing in XAML to generate your data bound grid in Silverlight? Then check out XAML power toys.

 

“XAML Power Toys is a Visual Studio 2008 SP1 Multi-AppDomain Add-In that empowers WPF & Silverlight developers while working in the XAML editor.  Its Line of Business form generation tools, Grid tools,  DataGrid and ListView generation really shorten the XAML page layout time.

It’s accessed through commands in the XAML editor context menu and the Solution Explorer item context menu.“

Deploying Silverlight Applications

Yesterday Microsoft announced a new way to get your web server up and running quickly with all required software like IIS and SQL Server (express). Great to get your ASP.NET and Silverlight application out of the door.

More information can be found here.

Upgrading To Silverlight 2 RTM

 

I’ve been busy upgrading my code to Silverlight 2 RTM, and from time to time I have trouble with the asp:Silverlight control, as if it doesn’t detect the right version of Silverlight. So when I view my application I get this:

image

The solution is easy: In your web project, from references remove the System.Web.Silverlight assembly, and then add it again.

Good news: Silverlight RC available

More here

Farewell to Patrick

Today was a moving day. Today is the day we all said farewell to Patrick. Today Patrick was carried to his grave, burning the lasting impression in our mind that we would never see him again, drink a nice beer with him again, chat with him again, nor party with him again…

I’m writing this red-eyed, because we all cried. We all cried saying farewell to Patrick.

Farewell Patrick.

Patrick
Wednesday 3 september our dear collegue and friend Patrick Tisseghem passed away unexpectedly. Still shocked and with great sadness I want to write some words, which will never be enough to express the sadness I'm feeling. Since the first time I met Patrick I have been impressed with the kindness and knowledge expressed by Patrick. Later I started working at U2U, where Patrick became my collegue, he became my inspiration and support even more. His drive was unparellelled. Also outside work Patrick was always great fun to be around, his energy astonishing. Patrick, I won't be the only one to say: We'll miss you. Life will never be the same. Words fall short...
Chopstick Noodle

A while a go I created a bunch of video’s for Microsoft Belgium chopsticks site.

Next week I’ll be doing a bit of Windows Live training, and of course I want to show the Silverlight Streaming Service, plus a number of plugins, like to one for windows live.

So here it is, the demo :)

1 - 10 Next

 ‭(Hidden)‬ Admin Links