Saturday 17 January 2009

Investigating Silverlight Exception: System.ArgumentException: Value does not fall within the expected range

Hi,

Good to be back in action after a long break. I just found this nasty little exception when i was adding a user control to a Grid in Silverlight 2. Took me some time to understand what was happening though, until i found that it was a known issue on the silverlight forum.

I managed to get a work around that problem which i promptly shared on the same forum.

System.ArgumentException: Value does not fall within the expected range at Ms.InternalXcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)

Turns out that every container needs a unique 'Name' property to be set for it's child. I have managed to get it fixed with the following self explanatory code snippet.

private static int componentID = 0;

private Grid tableGrid;

FrameworkElement element; //this is a user control.

element.SetValue(Canvas.NameProperty, GetComponentID().ToString());

private static int GetComponentID()

{

return componentID++;
}

//This will not give the 'Value does not fall within the expected range' exception.

tableGrid.Children.Add(element);

Wednesday 10 December 2008

Silverlight Toolkit - Merry Christmas!!

Go grab the silverlight toolkit from here. A newer version got released today. If you are wondering what's new,

Here, take a sneak peek

What's New?

  • More than 80 improvements and bug fixes
  • AutoCompleteBox and NumericUpDown have been moved into the Stable Quality Band.
  • Three new themes have been added: Bureau Black, Bureau Blue and Whistler Blue.
  • The sample application has been given a make-over and is now more polished and easier to navigate.
  • More tests added.
  • Better design-time support in both Visual Studio 2008 and Expression Blend, including icons, property tooltips and better property organization in the property editor.
  • AutomationPeer support added for AutoCompleteBox, Expander and NumericUpDown (as well as UpDownBase).
  • Charting improvements galore!

What's in the Silverlight Toolkit December 2008 release?

Some Links

Silverlight Tookit Quick View

Monday 8 December 2008

Motherjane - All set to create vibes from the fields of sound!!

_DSC7426_Edit

Motherjane a band from cochin (if i'm right) are a bunch of highly talented creative musicians. These guys are true artists.. Their sound is unique, lively, original and backed by good lyrics. I've been a fan since early 2002. I distinctly remember my first experience listening to 'Mindstreet' from a GIR CD (Thanks to montry) It surely did wow! me and since then i have huge respect for this amazingly talented band and boy they deserve some respect!. See the videos below. (i only wished that they managed to make a good video. It's noticeably a bit patchy, not polished well. It's a shame that such talented bands do not get noticed by creative media guys.) I guess we need to spread the word and so here i am doing exactly that..Their's nothing that comes close to describing their sound. All i can say is, the band has certainly taken huge influences from carnatic music and you can definetly hear that vibeing out of Baiju's guitar and eventally the band itself. The sound is unsurpassed, unmatched and totally phenomenal. To me they are inarguably the 'Indian' Dream Theater.

One of the most amazing things about both the music videos from ‘Maktub’ is that one was shot in 25 minutes (”Fields of Sound”) and one in 15 minutes (”Chasing the Sun”).

Maktub - Motherjane Promo

Fields of sound..

Long before religion, music is probably the first spiritual experience anyone is initiated into and this song is a celebration of the knowledge that our souls have been sung to..

Fields of Sound on youtube

Chasing the sun

"Time is the actual distance between people when ones chasing the sun". Brilliant Song!

The band's front man suraj speaks to split magazine on their experience with chasing the sun

"We, being a positive bunch, just enjoyed the trip. Twenty to thirty hairpin curves at an indecent speed took a lot of that joy out of us. As we reached, the sun was well on its way down and the place was closed to the public. It took a precious 25 minutes to find a cop who finally removed the barrier and let us in. Once again the shoot was on. We removed John’s drums and sped down a hill looking for a horizontal surface. We didn’t even have time to think about whether the sun would go down before we set up shop. Actually, I guess all of us did, in the back of our minds. The crew got one camera positioned and we played the song the first time. The sun was sinking. We relocated the camera and took shot number two. The sun was really on its way out. Like a friend of mine in the advertising world said, we all think there’s a lot of time in a day until a shoot happens.

The third time, the camera moved as a handheld. I still don’t know how much of that footage was usable and the only thing in our control was to enjoy the take. We did just that, standing on that beautiful mountain and looking over at the space that expanded before us and giving it all that we had as the sun made its final descent.

In retrospect, I can make the remark that we were ‘chasing the sun’ in every sense during the shooting of its video. "

 

All time favourite - 'Mindstreet'

Mmm, I take a step
in my sleep,
The id lies bleeding in mindstreet.
My angel's shot, full of holes
But now I know how to get him home.
In this world,
made of myth,
The rules change with every beat.
There's magic
in the air,
'Cos here the gods hear your prayer.
Come act your dream in mindstreet,
Do what you want, go where you please,
Kick the devil in his B's
Stop living on your bleeding knees
Will... not give up, they say,
This is the way to Serendip.
Close your eyes,
learn to breathe,
The oceans are just a few thoughts deep.
Believe me...Not in me,
The messenger is rarely worth it.
If you wanna trip, go inside
Where the secrets of the universe hide.
And this is how, it's meant to be
The journey is the way you pay the fee.
Come act your dream in mindstreet.
Do what you want, go where you please.
Kick the devil in his B's
You don't have to live on your knees.
Keep coming back, oh yeah
Human kind has always sensed his track.
Feels better everytime,
To know, that we are all divine

Saturday 6 December 2008

Ideas from IBM - You've got (TOO MUCH) mail..

This white paper can be found here. It talks about efficient ways of handling information overload. The other interesting aspect to look out for is the IORG (Information Overload Research Group) which consists of people from IBM, Microsoft, Intel and various academia. :-|

Schneier on Mumbai

Schneier talks about security w.r.t the Mumbai attacks.

http://www.schneier.com/blog/archives/2008/12/lessons_from_mu.html