14. September 2009
ZeroKoll
Silverlight
[UPDATE]
The code for the CommandManager has been rewritten due to some memory management issues. And together with that change, I have decided to put it on Codeplex. My blog posts about it are still more or less valid, but I suggest also taking a look at the code at http://agcommandmanager.codeplex.com/.
[/UPDATE]
Once again I return to the CommandManager that I have blogged about before. And I know it is getting boring and that I some day must leave that behind me and go forward. However, after having had a look at Prism/CAG/CAL and seen how Microsoft solves the commanding infrastructure, I have decided that the CommandManager still fills a purpose.
I also had a plan to retire the CommandManager completely and implement something similar using Behaviors. However, Behavior<T> or what ever it is called, inherits directly from DependencyObject instead of from FrameworkElement. This made it really hard to use in this situation, since it doesn’t support data binding. So I had to scrap that idea for now. It seems as if Microsoft uses this idea in Prism, but introduces an extra static object to get it to work… At least in the Prism implementation I have been looking at.
So why do I return to the CommandManager again? Just to argue that it is great and boost my ego? No…apparently, my previous implementation had a flaw. I might have a lot more, but I discovered one that caused problems. So I have rectified that…
More...
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...
20. December 2008
ZeroKoll
Silverlight
A couple of the guys at my company have started working on an internal Silverlight application. One of the guys is a former WPF developer, which gives him some serious advantages when starting with Silverlight. It actually gives him some serious advantages compared to my own sorry ass as well. However, it has some downsides as well. Downsides that sometimes end up with him sending me annoyed MSN messages.
He expects a bunch of WPF specific features to be available in Silverlight. I understand the "confusing". SIlverlight development is very close to WPF, except for the fact that Silverlight is in some aspects is tiny compared to WPF.
More...