Monthly Archives: December 2007

Silverlight 2.0: Project template for self-resizing applications (update)

.NET, Silverlight, Technical stuff
No Comments

An observant reader gave me a better way to automatically resize a Silverlight application. The way I published in my last post was inspired from Silverlight 1.0, where JavaScript is obviously needed to do the job. However, in 2.0, you can register for a CLR event and avoid the multiple conversions between JavaScript and C#. These conversions take time and it’s better to avoid them when possible. I modified the Project Template accordingly. You can download the updated version here, and follow the installation procedure here.

Read the rest of this entry »

Silverlight 2.0: Project template for self-resizing applications

.NET, Silverlight, Technical stuff
No Comments

Update: I posted an updated version which doesn’t use JavaScript. See here.

One of the first things I often do when I create a new Silverlight application is to make it self resizing. This is not very difficult, because thanks to the goodness of WPF (of which Silverlight is a subset), resizing a scene only involves one simple operation: a ScaleTransform. This transform applies to a panel (in this case the top Canvas) and to all its children. Using a ScaleTransform, all the distances (dimensions, but also coordinates) are multiplied by a factor, so you don’t need to move anything when the panel is resized. Additionally, since XAML graphics are vector-based, they will resize very gracefully (of course, if your application uses pixel-based graphics such as BMPs, PNGs, movies, etc…, then you will see pixels if you make the application very big).

Read the rest of this entry »

Blend: New version with complete Style properties

.NET, Blend, Technical stuff, WPF
No Comments

Blend December CTP was released a short time ago. Included in this new version is one change that I’d been requesting from Microsoft, and I am really happy they made it: You can now select every properties of a given element when you edit them in a style. In the previous version, some properties were hidden, for some reason, and you could only set them using the XAML editor. At least Width and Height were not visible in the properties pane, and maybe more. In the December CTP, this small defect is corrected, and you can set all the properties in the Style without having to write XAML. Good move!! Great tool!!

Read the rest of this entry »

Back in Switzerland after a WPF design week

.NET, Technical stuff, WPF
No Comments

This time it’s for good: I am back in Switzerland and I am not flying again before next year. Which is in 2 weeks. :-) The week has been amazing. While the team continued developing UI in Switzerland, I went to coach the graphics designers in Princeton. In a week, we didn’t “only” create XAML assets, but we also discussed the overall design and we are starting to have a very good idea of how the application is going tolook like eventually. It’s so great to be able to reproduce the static screens exactly how they look like, thanks to WPF. It’s so great to let the designers themselves do the changes they want in Blend, change pixels and shades and hues directly in the XAML. For the designers, they will sleep better at night knowing that the design they want is exactly how they want it. For the developer, it’s great because he can concentrate on the code and the features. And for the integrator (me), it’s great because of the incredible atmosphere of creativity. Really, it was electric. We’re not just doing UI, this is a kind of art. Functional art.

Read the rest of this entry »

LINQ training and trip to Princeton, NJ, USA and Swiss elections

.NET, Personal, Technical stuff
No Comments
LINQ hands-on lab at Microsoft Switzerland

Yesterday, a colleague and I attended a free LINQ hands-on lab given by Microsoft Switzerland in their offices of Wallisellen near Zurich. It was really good. I have seen LINQ in action a few times this year (actually, I had it demonstrated by no less than Anders Hejlsberg himself on one occasion, and Scott Guthrie on the other) but I had never tried writing queries myself. It was a good, 4 hours occasion to try it by myself. Needless to say, I was really impressed. What I really loved is that even though some parts are rather “magic” (lambda expression, object initializers, etc…) and remind of JavaScript, in the background everything is strongly typed. You get full Intellisense, and you can even debug the lambda expressions. Additionally, when you query against a SQL Server database (with the so-called “LINQ to SQL flavour of LINQ), and by installing a plug-in, you can even visualize the SQL query which is actually sent to the server.

Read the rest of this entry »

WPF: MCTS Beta exam

.NET, Personal, Technical stuff, WPF
No Comments

One neat thing when you’re a MVP (for 3 more weeks!) is that you get a lot of invitations to all kind of events. So when I got an invite to take the MCTS exam (beta) for WPF 3.5, I though I should try it, even though it’s my Most Busy December Ever. It’s not easy preparing for a Beta exam, because there are no courses, no books, no test exams available, so you’re pretty much left to yourself. Thankfully, I found a list of subjects online, and after marking those of them which I was really not feeling comfortable with, I sat down a few evenings with Adam Nathan’s book, and reviewed. When you learn a huge platform like WPF, there are areas which you know perfectly well, and others you never ever work with, and you really need a refresher. In my case, I needed a good brush up on Custom Controls (and themes), 3D, FlowDocuments and a few other areas.

Read the rest of this entry »