When Microsoft announced Windows 8 in September 2011 during the Build conference, I was very excited about the incorporation of Metro UI in the OS. “Fast and Fluid“, truly defined the first impression of Windows 8. I downloaded the Developer Preview and installed it on a virtual machine using VirtualBox. Though I did not succeed in installing it for the first time, I was successful the second time (after numerous searches on the web regarding this topic)! On the virtual machine, to be frank, the experience was not so awesome, but ok. The animations were a bit sluggish.

After installing, I played around with the OS for a few days. I created a few sample apps just to get a hang of metro apps. I was eager to create a major Metro App but was lacking the motivation (yeah, I can be lazy sometimes… :) ).

Then in December, Microsoft announced the Windows 8 First Apps Contest! The thought of having an app of my own as a part of Windows 8 was very appealing. Besides, it gave me the required motivation to delve into Windows 8 programming.

I had created an app called FlipSaw, which is an innovative version of the jigsaw game, in WPF. I was planning to port it to WP7 so that I could release it at the MarketPlace. As the time was short, I decided to port the app to Windows 8 first. The only problem was I had minimal knowledge about Windows 8 programming and I had only 1 week before the deadline of January 8th.

Since the platform is a developer preview, I had a tough time porting the code and getting it to work. I learnt a lot of new things in Windows 8 thanks to the developer community forums. I was able to get the code working only 4 hours before the deadline and couldn’t polish the app much!. Finally I submitted the app with only 15 mins to spare.

Then it was a week long wait. The Build Contest site mentioned that the finalists will be notified via email by Jan 15. But there was no update till Jan 15th 12:59 pm PST (Jan 16th 1.30pm Indian Time). So I thought I didn’t make it. In the evening, the site posted a message that the finalists have been selected and the mails have been sent. I checked my mail again but still my inbox showed zero new mails :(. With a heavy heart, I resolved to update my app anyway when the Beta came out and post it in Windows Store when it opened.

The next day morning, as I was checking my mails, I found a new mail waiting for me in the inbox.

To my utter joy, the subject read – First Apps Contest: You are a Finalist!

Well, I have two more weeks before the deadline of Round 2 (Feb 3rd). This round will be way tougher than the previous round. Time to smoothen the rough edges of my app.

Ok, I admit, this post should have been released a few weeks ago, but last few weeks had been pretty hectic and I was unable to post about my pet project WPFSpark which reached the v1.0 milestone last month. Yes, WPFSpark v1.0 is now released !

I have revamped the CodePlex page to give it a new look. You can access it here.

It also brings the following improvements to the existing three controls:

SprocketControl

Internal timer stopped when control is no longer visible. It is started only when the control is Visible. This reduces CPU load.

Added the LowestAlpha dependency property which indicates the lowest Opacity value that must be used while rendering the SprocketControl’s spokes.

Added the AlphaTicksPercentage dependency property which indicates the percentage of total ticks which must be considered for step by step reduction of the alpha value. The remaining ticks remain at the LowestAlpha value.

SprocketControl now implements IDisposable.

ToggleSwitch

Added the IsCheckedLeft dependency property which indicates whether the checked content appears in the left or right side of the ToggleSwitch

Added the CheckedToolTip property which is displayed when the ToggleSwitch is in the Checked state. Set this property to String.Empty( “” ) to prevent this tooltip from displaying.

Added the UncheckedToolTip property which is displayed when the ToggleSwitch is in the Unchecked state. Set this property to String.Empty( “” ) to prevent this tooltip from displaying.

FluidWrapPanel

Added the ItemSource dependency property which can be bound to an ObservableCollection<UIElement>.

Also, I have published articles on CodeProject detailing about the newly added controls . Do check them out. The links are available at the CodePlex site.

HTC just released their biggest Windows Phone 7.5 smartphone – the HTC Titan! From the first look, it seemed pretty impressive – the large 4.7 inch Super LCD screen, the fluid and elegant Windows Phone 7.5 OS, the 8MP camera with dual flash.
But a much deeper look into the hardware left me disappointed. Here are a few features I would have liked Titan to have to make it a sure winner in the long run-

Higher resolution – Having 800×480 on a 4.7″ screen is like watching a 720p movie on an HDTV. A 1280×720 resolution would have been an absolute killer feature.

More RAM – Its time we moved from 512MB memory for smartphones to at least 1GB. With multitasking a standard feature in almost all the smartphone OSes, an increased memory would indeed be a blessing.

Front facing camera – I expect it to be at least 2-3 MP for a better experience during video calls.

Extensibility – the Titan offers no scope of extensibility. An SD slot would have indeed been great.

Apart from all the above points, a major put off would be the price. If HTC can deliver a smartphone with great features at a killer price, it would be a surefire winner!

As I was creating the next control for my WPFSpark project – the FluidWrapPanel, a thought occurred to me. How will the FluidWrapPanel be notified when controls are added as its children via XAML?

As of now, FluidWrapPanel had an API called AddChild which would take a UIElement as a parameter. The reason behind this was that the FluidWrapPanel needs to perform some calculations before adding it to the InternalChildren. The UIElementCollection does not have a CollectionChanged to which we can subscribe to. Search over the internet yielded partial solutions to the problem. This MSDN link provided the initial starting point for my solution.

First, I defined an interface INotifiableParent which must be implemented by the Custom Panel requiring UIElementCollection change notification.

Next, I derived a class NotifiableUIElementCollection from the UIElementCollection class and provided a constructor, overriden methods (Add and Remove) and private member variable of type INotifiableParent.

In the NotifiableUIElementCollection, you can also implement the remaining overridable methods available in the UIElementCollection. In that case you must also expand the INotifiableParent interface to accommodate those methods.

While creating the next control for my WPFSpark project, I had the requirement of a WPF Grid with rounded corners. Since the Grid does not have the CornerRadius property, the other option I had was to encapsulate the Grid within a Border and set the ClipToBounds property of the Border to true. Then I found out that Border (and all decorators) do not perform the clipping even though the ClipToBounds is set to true.

The MSDN Forum provided an excellent solution on how to derive from the Border class and implement the clipping on your own. The ClippingBorder class mentioned in this site has a _clipRect field (of type RectangleGeometry) which is set as the Clip property of the ClippingBorder’s Child. But in this case the corner radius of the RectangleGeometry is same for all corners. What if you have a border with different corner radius for each corner and you want it to act as a clipping border?

I modified the ClippingBorder class to create the ClipBorder class which will take into account the above mentioned issue. Instead of a RectangleGeometry field, the ClipBorder class uses a PathGeometry to define the clipping Geometry. For this purpose I have used the GeometryHelper class (mentioned in my previous post) to obtain the RoundedRectangleGeometry. I have modified the GeometryHelper code further to take into account the BorderThickness of the ClipBorder.

Update: There was a small error in the calculation of the RoundedRectangleGeometry when the BorderThickness was 1 pixel. I have rectified it and updated the code. Thanks to Gene for pointing it out. :)