Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on 25th December, 2008

Another Silverlight clock experiment…

Another Silverlight clock experiment…

I started working on enhancing the previous Silverlight 2.0 clock I had made, en then I saw a Flash implementation of another creative approach of a clock and wondered if I could do that in Silverlight. Needless to say, I started working on it immediately and below is the result. This is another experiment that I thought I could do in just a few hours and it ended up taking me a bit more. Mostly because of the uneven conversions between the units and the different sizes between the boxes. Anyways, in a nutshell here is my approach: I have a very simple XAML file with only defining seven empty canvasses as placeholders, organized from top to bottom by a StackPanel. I will create and populate every single object dynamically and on the fly: I have a single method (CreateBasicCancas) that generates all the textBoxes for each individual gear. Then I have a single Storyboard that iterates every millisecond and that storyboard calls one single method (MoveGears) for all...

Read More

Posted by on 18th December, 2008

Silverlight Error when adding objects

Silverlight Error when adding objects

I 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...

Read More

Posted by on 14th December, 2008

Random animated clock

Random animated clock

I have done some code samples in Silverlight 2.0, but nothing worth sharing. So over the weekend, I saw an pretty impressive clock written in Flash and had to try to emulate some of its functionality in Silverlight 2.0. The clock can be seen here and I just loved the creativity, attention to detail and the smooth motion of the digits. For my experiment, I am only trying to (somewhat) reproduce the gyration of the number cluster, based on their location and individual rotation. Eventually, I will have more time to do it with all the digits and get it as smooth as in the Flash clock, with the subtle movements. For now, this is just a quick attempt at recreating the concept and will hopefully do… 🙂 mainpage.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace SilverlightRandomClock_Fixed { public partial class Page : UserControl { public Page() { InitializeComponent(); this.animateSeconds.Begin(); } private void...

Read More

Posted by on 14th December, 2008

Simulating snow…

Simulating snow…

With the winter not bringing us any snow so far, I thought I’d make some snow myself… I had seen some implementations of “snowmaking” here and there in Silverlight 2.0, but found that some implementations were too complex for just a Sunday morning project. So I figured I’d try it myself… It is a very simple concept: generate programmatically 200 Image objects, populate them and then have one Storyboard, that fires every milliseconds, go through each one of the flakes, and move them a few pixels further down. Of course, if this were a formal project, I would have made each flake their own class etc., just like Mike did in his example, but this experiment needed to be something simple, quick and still look somewhat realistic. As you can see from the amount of code, which is relatively little, a lot more can be done here. Maybe rotate the individual flakes, take them from randomly different images, so they are not all the same and speed up some...

Read More

Posted by on 1st December, 2008

Joining Microsoft…

Joining Microsoft…

Well, 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 headquarters in Redmond Washington. I will be joining the development team of the brand new store.microsoft.com site as a software 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...

Read More

Posted by on 20th November, 2008

SharePoint and InfoPath Data Extraction…

SharePoint and InfoPath Data Extraction…

I have worked over the last few years much with business process automation and especially with SharePoint. Here is a somewhat straightforward solution/approach to automate a much used, but manual process in SharePoint. Let’s say you have a document library that users upload documents to. Unless you subscribe to the library and want to be notified, not much really happens when the document lands in the library. So, what if you could have SharePoint take action immediately and initiate, let’s say a Workflow, or simply store the values somewhere else, or email a user with the details…or anything else that you want? And not just with the fact that a document was uploaded (that is already built-in), but, even better, with data from the actual document… Let me walk you through the scenario: we start out with one of the sample InfoPath forms: Asset Tracking and we publish a Form Library based off this InfoPath form to SharePoint. We end up with an empty Form Library as shown below....

Read More

Posted by on 19th November, 2008

Microsoft Silverlight 2.0 Progress…

Microsoft Silverlight 2.0 Progress…

Although it is undeniable that Silverlight has made quite an impact and, apparently been embraced without much resistance, it still has a long road ahead to catch up to its rival: Flash. As Scott Gu points out in his blog, more and more Rich Internet (and non-Internet as well) Applications are being written in Silverlight and the technology is becoming mainstream with the big names. On the other hand, Flash has clearly the upper hand. More than 10 years in the business and a platform that can be embraced by non developers, gave them a long early start. Just looking at the demand for developers in either realm on Monster.com gives you the picture:  Flash (2241) vs. Silverlight (178). A few good articles comparing these two platforms can be found here, here, here and here. So, as a developer familiar with both technologies, on which one would you...

Read More

Posted by on 14th November, 2008

Looking again…

Looking again…

Well… While on my vacation, OpenText finalized the acquisition of Captaris, for which I have been working for four years and… let's just say my badge stopped working when I returned. I am on the lookout again, dusting off my resume and working on some more experiments to learn new technologies and proof my skills. I have gained a tremendous amount of experience in .NET solutions engineering, enterprise software development, workflow, integrations and business process automation and am not quite sure in which area I will focus my...

Read More

Posted by on 11th November, 2008

6 tips from Europe….

6 tips from Europe….

For our 10 year wedding anniversary, I decided to take my wife to the places I grew up in and maybe try to explain some of my behaviors she has never quite understood. We visited Holland, France, Italy and Spain seeing friends and family and covered quite a bit in two weeks. We just got back today and here are a few thing I learned from this trip that you might find useful: Don’t rent a car unless you are very familiar with the driving style and the roads. Unlike in the US, the lanes are narrower, drivers are more aggressive, the streets are not organized by cardinal points (N,E,S,W) and are mostly named and not numbered. Prepare to use all your reflexes avoiding cars, scooters, bicccles and pedestrians in poorly marked and/or respected lanes. Also, gas is incredibly expensive and the likelihood that you’ll spend much time of your vacation stressed, either finding your way around or simply finding a parking spot is high. Instead travel by public...

Read More

Posted by on 1st November, 2008

SharePoint Feature Deployment Tip.

SharePoint Feature Deployment Tip.

In a previous article, I have shown how to build a SharePoint Feature and here is just a trick that could save you quite some time… The issues is that when developing a SharePoint features (or any other component), you end up writing, compiling and testing your code many times over. The code you are writing is a separate component that, essentially, has to be taken from Visual Studio, registered in the GAC, plugged into SharePoint and then manually activated. Then you realize something isn’t working, you make a change to your code, compile and you end up with a new component, but you can’t try it, before turning off and “unplugging” the component that is currently plugged into SharePoint. And that is just the class…if you make changes to anything inside the Features folder, you have to remember to upload that as well… In other words, it requires several manual steps outside of the development environment that could consume a lot of time. To make it easier for myself, I...

Read More