amCharts is a powerful financial charts control which support Line, column, candlestick, OHLC, step line and area charts type. It works for data-binding with various data sets. Of course, there are many other stunning features which greatly enhanced the chart viewing experience.
Nov
Stock Chart
Nov
Create Business Objects using RIA Services
A very basic tutorial guiding you to create your own Business Object using RIA Services. Read the rest of the tutorial in Deborah Kurata’s blog.
Nov
ADO.NET Data Services
A Game catalog which demonstrated how to use ADO.NET Data Services. You are able to witch between NHibernate and Entity Framework as well.
Nov
Interacting with different data source
Jeremy Likness explained in details 3 different ways (WCF, REST, Callback from browser) for Silverlight to retrieve data. Very comprehensive and useful tutorial.
Sep
Integrate with Browser Cookie
Integrate with the browser cookie for saving and accessing data in the cookie.
// sample usage
CookieManager.SetCookie("key", "value", TimeSpan.FromSeconds(3600));
string value = CookieManager.GetCookie("value");
// cookie manager class
public class CookieManager
{
public static void SetCookie(string key, string val, TimeSpan? expires)
{
SetCookie(key, val, expires, null, null, false);
}
public static void SetCookie(string key, string val, TimeSpan? expires, string path, string domain, bool secure)
{
StringBuilder fullCookie = new StringBuilder();
fullCookie.Append(string.Concat(key, "=", val));
if (expires.HasValue)
{
DateTime expire = DateTime.UtcNow + expires.Value;
fullCookie.Append(string.Concat(";expires=", expire.ToString("R")));
}
if (path != null)
{
fullCookie.Append(string.Concat(";path=", path));
}
if (domain != null)
{
fullCookie.Append(string.Concat(";domain=", domain));
}
if (secure)
{
fullCookie.Append(";secure");
}
HtmlPage.Document.SetProperty("cookie", fullCookie.ToString());
}
public static string GetCookie(String key)
{
String[] cookies = HtmlPage.Document.Cookies.Split(';');
String result = (from c in cookies let keyValues = c.Split('=') where
keyValues.Length == 2 && keyValues[0].Trim() == key.Trim()
select keyValues[1]).FirstOrDefault();
return result;
}
public static void DeleteCookie(String key){
DateTime expir =DateTime.UtcNow -TimeSpan.FromDays(1);
string cookie =String.Format("{0}=;expires={1}",
key, expir.ToString("R"));
HtmlPage.Document.SetProperty("cookie", cookie);
}
public static bool Exists(String key, String value)
{
return HtmlPage.Document.Cookies.Contains(String.Format("{0}={1}", key, value));
}
}
Sep
Load & Save File from Isolated Storage
Mike Snow demonstrated how to read file and load file from local storage. Please read the C# for details.
using System;
using System.Windows.Controls;
using System.IO.IsolatedStorage;
using System.IO;
namespace SilverlightApplication10
{
public class Page : UserControl
{
public Page()
{
SaveData("Hello There", "MyData.txt");
if (HasFile("MyData.txt"))
{
string test = LoadData("MyData.txt");
}
}
private void SaveData(string data, string fileName)
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(fileName, FileMode.Create, isf);
using (StreamWriter sw = new StreamWriter(isfs))
{
sw.Write(data);
sw.Close();
}
}
private bool HasFile(string fileName)
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
return isf.FileExists(fileName);
}
private string LoadData(string fileName)
{
string data = String.Empty;
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(fileName, FileMode.Open, isf);
using (StreamReader sr = new StreamReader(isfs))
{
string lineOfData = String.Empty;
while ((lineOfData = sr.ReadLine()) != null) data += lineOfData;
}
return data;
}
}
}
Sep
Transmitting data using JSON
Switch on The Code released an article demonstrating how Silverlight can communicate with JSON object using DataContractJsonSerializer.
Sep
Loading XML file
A detailed article released by kirual, teaching you how to get an xml data file from remote server.
Sep
Simple Data Binding in Blend 3
Alex Knight has written an tutorial teaching you how to use data binding wisely. You will find that data binding is extremely useful if you really understand how to use it.








