25. December 2008




Another Silverlight clock experiment...

ExperimentAnother attempt at yet another approach of representing time in an unusual manner. I saw this clock implemented in Flash and wondered what it would take to do this in Silverlight. Let's call it Mark II...

Here is my attempt... Again, as with many of these experiments, I thought I could make something work in a matter of a couple of hours and, especially this one, took me a bit more than that. I managed to consolidate a lot of the repetitive looping into one single method that moves all gears... 

See it for yourself here...


by Miguel Moreno

Category: Programming | Tags:

18. December 2008




Silverlight Error when adding objects

Silverlight Instance NameI have done a couple of Silverlight experiments where I programmatically generate objects on the fly and then attempt to add them to the Canvas. In one scenario, I was trying to generate 10 circles, give them some properties and then add them to the parent object, a Canvas, in this case.

However, when I did this, I got the following runtime error: "{System.ArgumentException: Value does not fall within the expected range." right when I try to add the instances to the parent (Children.Add()).

I wasn't able to find out exactly why this is happening, but after some digging, I figured that this happens because the newly created object instances have not been given a name and therefore the runtime cannot dynamically add two instances with the same name, or no names, for that matter...

So, to avoid this run time exception, all you have to do is to give your newly created instances a name, thus, in our case, simply add:  e.SetValue(Canvas.NameProperty, <name>); to your loop...

for (int i = 0; i < 10; i++)
{
   Ellipse e = new Ellipse();

   e.SetValue(Canvas.NameProperty, "e_" + i.ToString());

   e.Stroke    = new SolidColorBrush(...);
   e.Fill        = new SolidColorBrush(...);

   e.Width = 10;
   e.Height = 10;

   LayoutRoot.Children.Add(e);
}

Not sure whether this is the cause and the fix for this issue, but it seemed to fix it...


by Miguel Moreno

Category: Programming | Tags:

14. December 2008




Two more Silverlight 2.0 experiments...

ExperimentsI have been meaning to get some more Silverlight 2.0 experience under my fingertips and have taken a couple of Sunday mornings to acomplish a couple of experiments.

Nothing spectacular, but interesting nonetheless.

  • Silverlight Clock: emulating the concept of a fantastic animated clock I had seen done in Flash.

  • Silverlight Snow: Figuring that I would see so many ads, banners and logos with falling snow, I figured I ty my own approach. 

Stay tuned, as I will be working on more Silverlight experiments in the near future..

Read more...


by Miguel Moreno

Category: Programming | Tags:

1. December 2008




Joining Microsoft...

Microsoft StoreWell, that didn't take very long... a good opportunity presented itself almost immediately and although I was hoping for some downtime, I have decided to accept a job offer at Microsoft's headquartes in Redmond Washington.

I will be joining the development team of the brand new store.microsoft.com site as a web developer starting tomorrow. The store was launched just a couple of weeks ago and provides an online presence where one can buy any Microsoft product directly from the source.

It sounds like a great opportunity that I don't want to let pass....


by Miguel Moreno

Category: | Tags: