Jan
13
2010

Design Time Support for Data in Blend and Visual Studio 2010

Here are a few great articles on adding support for having sample data within Blend and Visual Studio 2010

http://karlshifflett.wordpress.com/2009/10/21/visual-studio-2010-beta2-sample-data-project-templates/

http://karlshifflett.wordpress.com/2009/10/28/ddesigninstance-ddesigndata-in-visual-studio-2010-beta2/

http://www.robfe.com/2009/12/the-curious-case-of-the-designdata-msbuild-target/

Nov
17
2009

How to make an AJAX call from inside Silverlight

Here is a little snippet that will let you make a remote AJAX call from inside Silverlight - the only catch is that you will get a "security warning" dialog for making a crossdomain call

ScriptObjectCollection scriptCollection = HtmlPage.Document.GetElementsByTagName("head");
HtmlElement head = (HtmlElement)scriptCollection[0];

HtmlElement script = HtmlPage.Document.GetElementById("dataAccess_js");
if (script == null)
{
	script = HtmlPage.Document.CreateElement("script");
	script.SetAttribute("type", "text/javascript");
	script.Id = "dataAccess_js";

	StringBuilder sbScript = new StringBuilder();

	sbScript.AppendLine("function createXMLHttpRequest() { var httprequest = false; if (window.XMLHttpRequest) { httprequest = new XMLHttpRequest(); if (httprequest.overrideMimeType) httprequest.overrideMimeType(\"text/xml\"); } else if (window.ActiveXObject) {  try { httprequest = new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch (e) { try { httprequest = new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch (e) { } } } return httprequest; }");
	sbScript.AppendLine("function retrieveContent(url) { var request = createXMLHttpRequest(); request.open(\"GET\", url, false); request.send(null); if (request.status == 200) { var text = request.responseText; return text; } else { alert(\"Error loading \" + url); } }");

	script.SetProperty("text", sbScript);

	head.AppendChild(script);
}

var result = HtmlPage.Window.Invoke("retrieveContent", sURL);
Jun
1
2009

Generic Databinding with Silverlight

This is one of those missing features that really makes you ask "what are they thinking" -- complex business systems that allow for on the fly customizations (something that is very common today) need to be able to be handled in Silverlight.

So if you are running into this and not sure how to proceed, here are some links that you might find useful

http://silverlight.net/forums/t/16733.aspx
http://silverlight.net/forums/t/63057.aspx
http://silverlight.net/forums/t/11570.aspx

http://silverlight.codeplex.com/WorkItem/View.aspx?WorkItemId=2810

Apr
28
2009

Creating and Handling Faults in Silverlight

http://msdn.microsoft.com/en-us/library/dd470096(VS.96).aspx

 

Apr
16
2009

A fantastic example of what Silverlight 3 can do

I highly encoruage everyone to check out Mike Harsh's sample application Slidentiy.  It does a great job of showing what is possible with Silverlight and best of all it comes with the source code in by C# and VB.NET

 http://silverlight.net/learn/appcorner/slidentity.aspx?pt=slidentity

Mar
24
2009

Silverlight Crossdomain Access Workarounds

Here is a great article discussing the issues and workarounds in Silverlight when you need to access data from a site that does not have a crossdomain or clientaccesspolicy xml file.

http://weblogs.asp.net/jgalloway/archive/2008/12/12/silverlight-crossdomain-access-workarounds.aspx

Mar
3
2009

Scott H talking about live databinding in Silverlight

http://www.hanselman.com/blog/TheWeeklySourceCode36PDCBabySmashAndSilverlightCharting.aspx
Mar
3
2009

A great article on some of the new free silverlight controls

http://timheuer.com/blog/archive/2008/10/28/silverlight-toolkit-released-with-charting-databinding.aspx
Mar
3
2009

Xamal Power Toys

Lately I have been doing a bunch of Silverlight work and in my wanderings I ran across these tool and thought I would share the wealth :)

 http://karlshifflett.wordpress.com/xaml-power-toys/

Feb
4
2009

A starting point for Sharepoint and SilverLight

Here is an article on getting started with SilverLight in SharePoint