Silverlight 3 issue with transparency and effects

I had this application that I had built for Microsoft while Silverlight 3 was still in beta. And then when SL  3 went RTW, a feature stopped working. Or as I found out, stopped working partly. After a bit of fiddling, I found a way around it, but it is still annoying. This is the story of finding my first Silverlight 3 RTW issue…

More...

www.office2010themovie.com is now live

The last week and a half, I have together with a handful of people at Intergen, built a new Silverlight site for Microsoft. I call it a Silverlight site instead of a Silverlight application, since it is actually an entire site. We created the whole experience inside Silverlight instead of having Silverlight “islands” on AJAX/HTML page. The project has been intense and fun. It is kind of interesting to see how much you can get done in such a short timeframe.

On Thursday the 2nd we had more or less nothing but a few line drawings from our design guy Dave. At the end of Friday, we had a skeleton, that is a more or less fully functional site without any layout. ListBoxes on a white page just showing that the data was coming from over the wire from our WPF services.

More...

Adding mouse wheel scrolling in Silverlight

I have just gone through a project that used mouse wheel scrolling of different elements in the application. There are probably a LOT of different ways of doing this, and this is absolutely not something new. But I wanted to make the solution re-usable by using attached properties.

The only issue with handling the scroll wheel is that Silverlight doesn’t support that, and does not expose an event for that. So you have to roll your own. This is not hard to do. All you have to do is handle the mouse wheel events from the browser using the JavaScript bridge.

On a side note, I did actually find this blog that talks about using UI Automation to handle the scrolling instead. Even though this seems like a cool solution, I was too far down the other line to turn back. So my solution is using the traditional JavaScript way…

More...

Silverlight 3 RTW is released

Yes, I know. I guess I have to add this mandatory post. I have known about this date for quite some time now and also played around with SL3 for a while now. My first SL3 app was built about 5 months ago and I’m just putting the finishing touches on another one for Microsoft.

It is cool that is out there now and that we can finally start deploying apps on the new platform. Big congratulations to the Silverlight team! Great effort! Hope we get even more nice things in Silverlight 4. Keep up the work!

I will blog more about it as soon as I have time. However, I have more Silverlight 2 things to talk about as well. A few little tips and tricks that we picked up during the last project.

The MouseOver state visuals are reset by the Pressed even if I haven’t told it to

I’ve recently come up with a thing that is probably old news for most people. But to me it was new. I have styled a bunch of things lately, among them a bunch of buttons. Most of the buttons had MouserOver states, but no Pressed state. So I changed the template of the buttons and added my VisualStateManager (VSM from now on).

Being lazy as I am, I opened up generic.xaml and stole the original style for the button. And no, I did not use Blend! Why not? Probably because I’m a stubborn meticulous person who like coding things on my own…

More...

Playing Smooth Streaming (.ism) videos in Silverlight…

I’m currently working on this Silverlight project, that will be a growing video archive that you might see go online in the close future. Unfortunately I can’t say more at the moment. But that is not what this post is about. The post is about playing Smooth Streaming videos in Silverlight.

I’m not that familiar with media streaming and video formats and so on, but when we started talking about playing video, I insisted on it being streaming. Http progressive download is just not that attractive and great… It will use up unnecessary bandwidth as well as cause certain “issues” at the client. Such as limiting the users ability to “scrub” though the video…

More...

Changing the layout for the selected item in ListBox

I’m currently working on a Silverlight 2 application that will go on-line in about a week. It is not a big application, at least not if you look at the functionality in it, but it still has it’s challenges. Especially graphical ones. But this was one that I didn’t actually expect would cause a problem…

Our designer has worked up some nice layout that we need to implement. One of the features in the layout is a list of items that the user can select from. Obviously a ListBox. But the thing that caused problems, was the fact that it was supposed to show a compact information layout for all items except the selected item. The selected item should have a more verbose layout and some extra functionality. Initially that seemed like a tiny problem. That would just be a ItemTemplate with a VisualStateManager. Apparently not…!

More...

Silverlight 3 - MergedDictionaries

After having worked a while with Silverlight you realize that you often keep a lot of things in resources in your Xaml. Not only do you add Storyboards for your animations, but you often also add styles and templates, and some converters and so on. The resources all of the sudden start taking up most if the rows in your Xaml. It becomes hard to read. Especially since Silverlight is all about styling and templating controls, which results in large amounts of Xaml.

It is also hard to share resources. Say that you have these converters that you use in several of your controls. How do you solve that? Having them declared in multiple places is no good.

In Silverlight 2 there wasn’t much you could do. You would just have to have all of those resources in your Xaml, and if you wanted to share them, they had to be in the App.xaml file.

More...

And then Firefox does it differently…reloading the Silverlight control when the css changes…

I’ve, as you maybe know, been working on a Silverlight flickr viewer for my fiancées blog. And now that I have finally got it all done, blogged about it and so on, it was time to actually implement it on her blog. So I took the code from my blog posts and built my services and view models, but tore out the entire view layer and replaced it with a somewhat prettier thing. It has a thumbnail view that is visible in her blog posts. It looks as small Polaroid photos scattered on her page. And then when you click one of them, it changes to a full screen view and shows a larger Polaroid picture with the pictures description an handwriting.

More...

flickrVIEWR – A flickr viewer in Silverlight – Part 3

I guess it is time to tie it all together and get the UI up and running for the flickrVIEWR. As you will notice, having built the viewmodels, the code for the UI is actually very simple. And the cool part is that there is no code in code behind at all.

But before I start creating the Xaml for the application, I’m going to hook up the viewmodel to the page and do a few little bits and pieces needed to get it all working.

More...