You are currently browsing the category archive for the ‘Community’ category.
I would like to show an example of application that is about how to use Fluent Ribbon control together with Prism (aka Composite WPF). Our team is using this combination for some time already; although, with various degrees of success: the Fluent Ribbon is not enough mature (but pretty stable) and my personal relation with Prism is kind of love/hate. The Castle Winsor is starring as IoC Container of choice.
The code is not something extraordinary by any means. You can find lots of similar samples for other controls in the net. It’s just a sample how to use these libraries together.
In this example I’ve set next scenario: a module (or another part of application) wants to add new RibbonTabItem to existing Ribbon without having a direct reference to it. Also, application should support activation/deactivation and removing of Tabs.
The basics are pretty straightforward: pick/write an IRegion, write an adapter to work as a mediator between it and control being extended, profit!..
I’ve decided to use an existing Region to serve as host for tabs – SingleActiveRegion. It seems to fit well expected behavior.
Two classes that I wrote are RibbonRegionAdapter and RibbonRegionSyncBehavior. The behavior class is used to synchronize the Tabs collection of the Ribbon with Views and ActiveViews collections of the SingleActiveRegion. Adapter serves only to instantiate the region and attach the behavior.
Also, this solution uses Castle Windsor to wire up all things. The WindsorBootstrapper class wires up an application based on Prism v2.2 and Castle.
I’ll not publish the the code here, you can “git clone …” it from repository on GitHub. Or, from the same place, you have the option to download sources.
Future plans include few more regions (Backstage, RibbonTabItem) and may be some tests.
Solution specifics:
- Prism v2.2
- Fluent Ribbon rev. 51299
- Castle Windsor 2.1.1
- VS 2010 & NET 4.0
Disclaimer: code is provided “AS IS”. It may contain bugs and not be written in best possible way. I’m not a Prism specialist by any means. Any help is welcome if somebody can improve this code or wants to contribute for a more meaningful example…
A small write up about my experience at TechDays 2010, Geneva, Switzerland. Kind of random thoughts and superficial impressions about visited sessions.
Windows Azure platform
Depending on your requirements can be a cost efficient deployment option. Not sure about development side of things. If it’s covering 80% of your requirements nicely, what about 20% cases it’s not covering? Most of MS technologies/frameworks are hardly known as being extensible.
SQL Azure & Azure storage
Will it play nicely with NHibernate? I’ve seen mentions on the net that all NHibernate tests are passing on Azure platform. Would like to see a real app.
“Tables” as a document store are interesting. Is it supporting Map/Reduce?
Silverlight 4
After few releases and years it will be on par with WPF (as of 4.0/2010).
I’m loving choice of platforms: PC, web and mobile.
Windows Phone 7
I’m a Windows Phone 7 developer! C# & XAML everywhere. VS 2010 & known tools/process. Not convinced on new UI concept. Don’t like the strong accent on social networking. During presentation had a temptation to stand up and ask: “can it make a call?”.
Silverlight 4 Advanced
Definitely, in a few years Silverlight will be on par with features with WPF.
Nice presentation, learned few tricks in Blend and VS 2010. Presenter looked and worked like a real developer.
Microsoft Surface & Multi-touch experience
I’ve skipped a session and took a chance to play with Microsoft Surface installed by one of (i think) sponsors in the hall. I’ve started playing with it between sessions and missed completely beginning of new one. Dropped it and played one hour with Surface and a HP branded mono-block with multi-touch screen.
Multi-touch is working great on Surface: few games, Paint, Maps. Few very basic, specific apps with “intuitive" interactions. I’d like to see how it works in a more business/data analysis/LOB app. But I’m rather skeptical. They had some kind of “business” app on the Surface but it doesn’t worked because some physical “tags” where missing.
HPs with multi-touch screens: Windows 7 is not a multi-touch friendly platform. You can create small nice “photo viewer” applications but this will not make a revolution – the platform is mouse+keyboard oriented. You can look at iPhone/iPad, where the platform is built on and for multi-touch. Windows Phone 7 is a multi-touch platform with few pre-defined styles for basic controls & specific navigation features.
Found a bug with multi-touch – you cannot close a window by pressing “X” button when the screen is maximized. Probably a hardware issue.
And I haven’t found how to show a context menu (right mouse click) in Windows 7 using a “touch”. As I said previously, the platform is not touch oriented.
Conclusion: Touch interfaces offer good user experience in specific devices and apps. Very specialized and artificially limited. But for “traditional” apps it’s not a good choice. And don’t forget the whole Web. Keyboard and mouse are here to stay.
Yesterday I have participated at my second meeting of ALT.NET community in Switzerland. The ALT.NET Swiss group was running for some time, but I’ve discovered it recently, after being contacted by Frédéric SCHÄFER from OCTO Technology. He started the group and has been organizing meetings in Lausanne and Geneva. Many thanks Frédéric and keep up a good job!
First meeting I attended was about WPF and Model-View-ViewModel pattern implementation. It was held by Frédéric SCHÄFER. He took a simple WPF application and slowly modified it to use MVVM pattern. That got us better separation of concerns and maid application more testable.
The yesterday’s meeting was for me a special one, I was one of the speakers.
I’ve talked briefly about how the MVVM pattern is used with WPF, showed a "classical" implementation of it and after that presented some improvements over that. The initial ViewModel had INotifyPropertyChanged implemented and used ICommand to respond to UI actions initiated by view. For two properties and a command there was a lot of "ceremony" – code being there just to comply with implementation requirements. At the end of the session, by using two frameworks(BLToolkit and Caliburn) , I’ve managed to reduce the volume of the code by the half while maintaining initial functionality. Why is this important? Shorter code means less place to make a mistake, hide a bug, it’s faster to read and understand. I will write a separate blog post about my solution.
The other speaker was Daniel Vaughan, the author of Calcium SDK. He spoke about Calcium SDK, which is a set of additional services and modules built on top of the Prism (Composite WPF) and few Visual Studio templates to make creation of composite application easier. After that, he talked about compile time validation of WPF’s binding expressions. This, being a real headache for WPF developers, was addressed by Daniel by using template engine backed into Visual Studio – T4. His solution is very interesting. He generates some metadata classes with static properties and after that uses them in binding expressions. I’m still not sold on the whole idea, but I should spend some time playing with it. But presentation was nice, thanks Daniel!
It was a great evening. It’s always interesting to meet people with different set of skills and experience, you can look at known problems from other angles, getting suggestions or criticism. Or you just can learn something new.
Special thanks to Atif Aziz and Cargill International SA for hosting the session.
Update: published the code on GitHub.
