12. February 2010




Silverlight Validation & Tootip Styles...

SSilverlight Validation Tooltip stylesilverlight 3 comes with built-in validation for many of the input controls. Setting them up is fairly easy and they are styled well enough that you could use them right out of the box.

If you would like to know how to set it up and also would like to customize the look and feel of the fields and validation message, this short tutorial will explain how to do just that. 

See more here: Silverlight Validation & Tootip Styles...


by Miguel Moreno

Category: Programming | Tags:

18. January 2010




Wavelength to Colors in Silverlight

IWavelength to Colors haven't done many experiments lately and thought I'd do a quick one I have been meaning to do for a while.

It is basically a slider that runs from 350nm to 780nm (visible spectrum) and displays (I think accurately) the resulting color and graphical wavelength.

I had done something failry identical in a Windows application several years back, but wanted to do it in Silverlight.

See it here: wavelength to colors.


by Miguel Moreno

Category: Programming | Tags:

27. September 2009




Another Silverlight Clock experiment...

Continue TimeI thought I had told myself I wouldn't do anymore watch or clock-related experiment. Well, maybe one more and this is it...!

In this case, I saw a YouTube movie showcasing a beautiful and elegant clock designed by Sander Mulder. The simple clock has a single arm, fragmented in three parts, representing the hours, minutes and seconds arm all correlated and pointing in the correct direction at any time. 

In this simple experiment I attempt to recreate the motion of the arms of this clock in Silverlight 3.

See the experiment here...


by Miguel Moreno

6. July 2009




Vacheron Constantin watch experiment..

This morning I ran across an article about some watches and there is one that caught my attention. It is a Vacheron Constatin Mercator America and it is a beautifaul watch. A bit pricey, but if I ever have $47.500 that I don't need, maybe I'll get it some day.

The hands of the clock represent what are called nautical dividers and are used by navigational officers to quickly determine distance on a maritime chart.

Here is my attempt at recreating the design of this watch in Silverlight: Vacheron Constantin Mercator America watch experiment.


by Miguel Moreno

Category: Programming | Tags:

27. June 2009




Web.Config inheritance tip...

web.config tipMainly writing this entry so I don't spend hours looking for a solution when I need it again, since I tend to forget rather quickly how exactly I solved a problem. In this case, I have a website that is ASP.NET 3.5 and a folder which contains a different .NET application. I understand that the web.config in the root of the site, will cascade down into the applications within by default. What if our application within uses different settings... how do we prevent the settings in the root to affect the child applications?

Well, I learned that this can be accomplished in two parts. First there is a somewhat undocumented trick to instruct IIS that we do not want the settings to be inherited by child applications. You will need to wrap your <system.web> tag in a new tag, named <location> with the attributes as shown below: 

<location path="." inheritInChildApplications="false" >
  <system.web>  
    [...]  
  </system.web>
</location>

Note that this will show a red squigly line in Visual Studio since the inheritInChildApplications attribute is unknown to VS. 

Now, this only seems to work with <system.web>...what if we need to do the same with, let's say the <configsections>...? Assume we are pointing to System.Web.Extension dll, version 3.5 in the root and we want to point to a version 1.1 in the childApplication? In that case, we cannot use the <location> trick mentioned above. Instead, we can to do a runtime binding redirect in the web.config of the childApplication as shown below: 

<configuration>
  [...]
  <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions"
                                          publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="3.5.0.0"
                                       newVersion="1.0.61025.0"/>
          </dependentAssembly>
      </assemblyBinding>
  </runtime>
</configuration>

Enjoy!

by Miguel Moreno

15. March 2009




Silverlight 2.0 Moonlander game...

Silverlight MoonlanderA quick post here on an experiment that has taken way too long and maybe I have lost interest over time or it just became a bit more than a short experiment. In essence, it is a replica of the 1980's Moonlander arcade game.

I was shockingly surprised that Silverlight 2.0 does not have an obvious built-in HitTest or collision detection method for individual objects and the known workaround is quite clever, but somewhat less than elegant nor efficient, especially when checking many objects at the same time.   

I haven't really formed an opinion yet, since I may have overlooked features that are in the Silverlight 2.0 box and will post so, if I come across such feature. In any case, here is the game.

See it here...


by Miguel Moreno

Category: Programming | Tags:

22. January 2009




More free stuff from DevExpress...

DevexpressIn a previous post I had mentioned about 60 free .NET components available at no cost at all. These are high quality controls and I still have to try many of them. 

Well, looking for a Silverlight Datagrid, I came across Devexpress again and noticed they are offering these two compoent sets for free, including their source code. 

  • Silverlight Datagrid Control - here
  • Silverlight Menu - Toolbar controls - here

I used to love Xceed andComponentOne controls, but they are expensive and Devexpress has become one of my favourites since they make it nearly impossible not to try/use their components and become a fan of them...

I just thought I'd post this, because there aren't many Silverlight Datagrid controls and this one is free. I will likely be doing some experiments with these controls, as soon as I am done with another Silverlight experiment I am working on..


by Miguel Moreno

Category: Programming | Tools | Tags:

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:

20. November 2008




Added a couple of SharePoint Experiments...

SharePoint ExperimentsNot really experiments, but two brief articles I had been meaning to write for some time, simply to share some interesting approaches to developing Features for SharePoint:

  • A handy approach to automating your build process when writing a Feature: deactivation, uninstallation, unregistration, registration, installation, activation and recycling the application pool, all in one easy step.

  • Automatically extract data from an InfoPath form when uploaded to a SharePoint Form Library. Indispensable approach, especially when automating business processes or integrating non-homogenous enterprise applications.
Check them out here...

by Miguel Moreno

Category: Programming | Tags: ,

19. November 2008




Microsoft Silverlight 2.0 Progress...

Flash vs SilverlightAlthough 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 concentrate...?


by Miguel Moreno

Category: Programming | Tags: ,

13. October 2008




Microsoft Releases Silverlight 2...

Silverlight 2.0"Microsoft Corp. today announced the availability of Silverlight 2, one of the industry’s most comprehensive and powerful solutions for the creation and delivery of applications and media experiences through a Web browser.

Silverlight 2 delivers a wide range of new features and tools that enable designers and developers to better collaborate while creating more accessible, more discoverable and more secure user experiences."

Read more: press release.


by Miguel Moreno

Category: Programming | Tags: ,

14. August 2008




Intellisense not working in Visual Studio...

"IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment. In addition to completing the symbol names the programmer is typing, IntelliSense serves as documentation and disambiguation for variable names, functions and methods using metadata-based reflection." (Wikipedia)

So, I can't quite remember when exactly Intellisense stopped working for me in Visual Studio 2008, but I know I have been without (automatic) Intellisense for quite a while.When typing a dot after an object or method, it used to just show up automatically... I could however have it come up by pressing <CTRL><SPACE> and eventually got in the habit of just doing that when I needed it, without attempting to find out exactly why it was broken in the first place...

So, several months later, I stumble upon an entry by Richard Fennell, who explains how to fix it. I thought I'd post it for when it breaks again, I know where to find the answer...

In Visual Studio 2008, select Tools > Options > Text Editor > All Languages. Ensure that the checkboxes in the Statement Completion section are actively checked (not grayed out).

That is it!. Click Ok and try it.


by Miguel Moreno

Category: Programming | Tags:

12. August 2008




Free license for 60 DevExpress controls...

DevExpressHere is an opportunity to take advantage of: DevExpress is offering single developer licenses for 60 of their controls free of charge – without royalties or distribution costs.

These are very high quality controls that should not be left out when considering any web (or windows) application development project. You see their ads in MSDN magazine every month and this is your chance to get them and use them without spending a cent.

"Once you register, you will be forwarded an Email with your login credentials to our product download portal. With this information in hand, you will be able to download and install all the controls and tools listed above free of charge. The applications you create with these controls can be distributed royalty free (see the EULA that accompanies the products for more information). Note that the installation you download will include evaluation versions of our entire product line. You can install these trials if you wish during the setup process. Visual Studio 2005 and Visual Studio 2008 are fully supported." (devexpress)

Read more: http://www.devexpress.com/...


by Miguel Moreno

Category: Programming | Tags: ,

12. August 2008




Optimizing tools for ASP.NET

We all know that you can ask for directions to the same destination multiple times and get different answers each time.

They will all lead you to your destination; however, some direction may get you there faster, some have a more scenic panorama, some with clear instructions and others are difficult to follow. 

The exact same is true for software development; each developer will write code their own way and have a reason as to why some function was written a certain way. However, with software, a key requirement is that we often don't want the elegance, the scenic nor the "pretty" code, but simply the code that executes efficiently, robustly and fast. How do you know if your code does exactly that...? You don't really know until you take your code for a test run and measure its performance...

There are a ton of tools out there that will assist in giving you a diagnosis of speed, performance, etc. 

Morgan at PHPVS.net has written a good article highlighting 9 essential tools that a developer ought to have to testrun their code and optimize it for deployment.

Read more: http://www.phpvs.net/2008/08/...


by Miguel Moreno

Category: Programming | Tools | Tags:

11. August 2008




Visual Studio 2008 and .NET 3.5 SP1 released

Visual Studio 2008Visual Studio Service Pack 1 and Microsoft .NET Framework 3.5 Service Pack 1 have been released today. The downloads are available here: 

"The .NET Framework 3.5 SP1 includes a lot of improvements and especially TONS (literally tons) of performance improvements for WPF applications, ADO.NET Entity Framework, ASP.NET Dynamic Data, ADO.NET Data Services Framework and much more…

PLEASE NOTE: If develop Silverlight apps with Visual Studio, please note that after installing Visual Studio 2008 SP1 you must update the Silverlight Tools (more info and download links are available here)." (via MSDN blogs - pblog)


by Miguel Moreno

17. April 2008




Silverlight 1.0 Chase Game

Silverlight Chase GameHere is another example of my forgetfulness... I saw a small, addictive Flash game somewhere and I can't find it anymore. It involved an object that you could drag and then several other objects moving around the screen.

The goal is to avoid touching any objects or the walls.

Here is my attempt at recreating this small game in Silverlight 1.0 (click on the image). As usual, nothing refined, just a functional model.

You may wonder why I am not diving into Silverlight 2.0...? Well, that version is still in beta and although I have experimented with it, I don't want to post any example yet, as most folks still have the 1.0 version installed and may not want to install a beta version of the player.

Enjoy! 

Silverlight Chase Game 


by Miguel Moreno

Category: Programming | Tags:

5. March 2008




Silverlight 2.0 Beta 1 available for download....

Silverlight 2.0Finally Silverlight 2.0 Beta 1 has been released. This is a big release with lots of new features, as Scott Guthrie mentions: "Silverlight 2 includes a cross-platform, cross-browser version of the .NET Framework, and enables a rich .NET development platform that runs in the browser. 

Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby)."

Of course I w illbe posting some new experiments very soon.

Get the download, documentation, SDK and tools via silverlightexamples.net 


by Miguel Moreno

Category: Programming | Tags:

27. February 2008




Silverlight 1.0 Video Slidepuzzle

Silverlight 2.0 is about to be released in the next few days and I had yet to spend any time with version 1.0. I barely know how it works and thus decided to take a few hours here and there and put together a meaningless, but fun project, just to understand how it works.

Also, I know that the newer version 1.1 is in alpha and readily available, but I wanted to however still learn with the first version and understand the core basics of it.

This technology has tremendous potential and will be key in many, many future applications, especially with its close integration to .NET as it is basically a subset of Windows Presentation Foundation. Unlike (formerly Macromedia) Flash which uses Actionscript and a propietary editor, Silverlight uses standard languages such as XML, Javascript and any of the .NET languages in the next version. 

My first humble attempt at this technology produced a slide puzzle, like we all used to have as kids, but instead of a static image, its pieces contain a fraction of live video. Check it out!

Silverlight 1.0 Video Slide Puzzle


by Miguel Moreno

Category: Programming | Tags: