March 2008 Entries

Silverlight and FriendFeed

Since FriendFeed has produced an api I thought it would be fun to produce a little Silverlight app or control that could consume it. I thought this would be as simple as the digg example given in the Silverlight Quickstart - and it should be! Unfortunately the guys at FriendFeed have not added a crossdomain.xml or  clientaccesspolicy.xml which stops Silverlight (and Flash for that matter) from making cross boundary calls to their api. Took me a while to figure it out, so hope this helps someone. Moreover I hope FriendFeed fix this one quick snap! Cheers Ian Technorati Tags: Silverlight,FriendFeed,crossdomain

Linq to SQL Nulls

The way Linq to Sql deals with nulls had me scratching my head initially.  At first things seemed simple - for example the following does exactly what you would expect (Mike Taulty goes into more details on why here): Customers.Where(c => c.Region==null) This resolves to the following SQL: SELECT [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address],        [t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax] FROM [Customers] AS [t0] WHERE [t0].[Region] IS NULL Notice that the Where clause uses IS NULL rather than = null which is correct.  However if I pass a null parameter to the query then the SQL is resolved incorrectly.  For example: string region=null; Customers.Where (c => c.Region==region); This...

Silverlight 1.0 Image Rotator with Ajax

Silverlight 2.0 might be all the fashion but 1.0 is released and out there, so there is value in using it purely for the wider reach and acceptance of users who are happier to  install the released plugin. So here is a easy little app you can write your self to give you an image rotator with click through and whatever logic you want for the weighting of the images. It fits together as follows: A Silverlight Xaml page with some JavaScript to control it An Asp.Net web page with the Script manager from the...

IE8: Principles vs Pragmatism

Joel Spolsky has an entertaining and thought provoking read on why IE8 renders Google maps and live maps so poorly.  Actually it is much more than that and Joel does a great job of explaining the battle between having IE8 default to the new "standard" rendering model, or to the old IE7 one.  He concludes: You see? No right answer.  As usual, the idealists are 100% right in principle and, as usual, the pragmatists are right in practice. The flames will continue for years. This debate precisely splits the world in two. If you have a way to buy stock in...

Learning Linq with LINQPad

If you are getting into LINQ - then this free, copy and run app, is a great way to play with it. It's a companion to C# 3.0 in a Nutshell but it is valuable without the book, and comes with 200 samples! Recommended!   Cheers   Ian Technorati Tags: Linq,LinqPad,C#,Nutshell

Multiple Administrators for Windows Live Domains

Windows Live Domains is an easy way for you to get free "Hotmail" type accounts for a domain you own.  You simply visit domains.live.com and follow the instructions.  This will eventually open up an Admin Centre that you can use to manage accounts, set-up co-branding, and generate a sign-up module.  You authenticate as an administrator for the domain via an existing live id account, and by making a change to DNS for the domain you want to manage (thereby proving you own or manage it) Since this authentication is tied to an existing live id, this seemed to imply that only...

Expression Web 2 - some nice new features

Gary Pretty has a detailed post on some of the new features in Expression Web 2  - I hadn't realised there was so much goodness in it!   Gary lists the following:  PHP Support - PHP Intellisense and syntax highlighting, and previewing of PHP sites locally, without the need for a separately installed web server ASP.Net & AJAX Controls  - full support for the standard ASP.Net Ajax controls to simply drag and drop them into your page Silverlight 1.0, Windows Media & Flash -  drop your Silverlight 1.0 applications straight...

Exporting GeoRSS from a Virtual Earth Collection

There is currently no api method for turning a Virtual Earth Collection from maps.live.com into a GeoRss file. However there is a workaround that you can use as follows: Open your collection on maps.live.com Click the Share button and select either "Send in e-mail" or "Copy to clipboard" - what you want is the URL for the collection Visit the URL in the clipboard or the e-mail - it will be something like: http://maps.live.com/?v=2&cid=FB8B852EF1AB0B35!519&encType=1  When the collection is displayed you will see a Subscribe link at...

Code Samples and Resources

MSDN Code gallery: http://code.msdn.microsoft.com I wasn't aware of this until someone pointed it out in a presentation at Mix this year. It is a growing set of code samples and resources created by and for the community.  There is already a lot of good stuff there:  Here are a few that have caught my eye: An Example of a Multi Tier Architecture for Linq to Sql Silverlight Web Services Samples Internet Explorer 8 MIX08 Hands-on Labs   Cheers ...

Virtual Earth JavaScript Intellisense

Virtual Earth has a great api, better than Google Maps IMHO, but JavaScript is PITA if you have no editor support.  VS2008 has brought Intellisense to many JavaScript scenarios, but not to VE development - up until now that is. A Code Plex project (that I had the pleasure to be involved in, though in a tiny tiny way, because the project was completed so quickly! - I expect to be more involved in future iterations) has made it easy to have JavaScript Intellisense for VE in Visual Studio. The Virtual Earth: An Evangelist's Blog has a good...

Automatically Scaling Content in Full Screen Mode in Silverlight 2

Technorati Tags: silverlight,silverlight 2.0 Silverlight has great full-screen support, and it is a simple matter to switch to full screen by setting the IsFullScreen property of the content object as follows.  Note for security reasons this can only be done in response to user input; note also that this code has changed from version 1.1 alpha   //get the plugin content object System.Windows.Interop.Content content = Application.Current.Host.Content; public Page() { InitializeComponent(); // wire up key down and full screen changed events this.KeyDown += new KeyEventHandler(Page_KeyDown); content.FullScreenChanged += new EventHandler(Content_FullScreenChanged); } void Page_KeyDown(object...

.Net/Silverlight Tools and Versions Summary

Technorati Tags: .net,silverlight,visual studio I was recently asked to detail the various .net and Silverlight versions in a simple table - here's my attempt (this is all available at www.asp.net/downloads but I must admit I found it useful to try and summarise the essentials here) Version Released Tools Summary Comments ...

«March»
SunMonTueWedThuFriSat
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345