<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aimee Gurl... &#187; Code Bits</title>
	<atom:link href="http://aimeegurl.com/tag/code-bits/feed/" rel="self" type="application/rss+xml" />
	<link>http://aimeegurl.com</link>
	<description>for as long as i can remember, technology has always fascinated me</description>
	<lastBuildDate>Thu, 13 Oct 2011 12:07:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using the Facebook Developer Toolkit 2.0 for Canvas Based applications</title>
		<link>http://aimeegurl.com/2008/08/27/using-the-facebook-developer-toolkit-20-for-canvas-based-applications/</link>
		<comments>http://aimeegurl.com/2008/08/27/using-the-facebook-developer-toolkit-20-for-canvas-based-applications/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 16:03:26 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code Bits]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook developer toolkit]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2008/08/27/using-the-facebook-developer-toolkit-20-for-canvas-based-applications/</guid>
		<description><![CDATA[I missed the release of the latest version of the Facebook Developer Toolkit from clarity consulting so I decided to play around with it after our Mix It Up event. There have been much changes to the toolkit since the last time I looked into it. It took me a few minutes to try to [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>I missed the release of the latest version of the <a href="http://www.codeplex.com/FacebookToolkit">Facebook Developer Toolkit</a> from clarity consulting so I decided to play around with it after our <a href="http://www.microsoft.com/singapore/msdn/mixitup">Mix It Up</a> event.</p>
<p>There have been much changes to the toolkit since the last time I looked into it. It took me a few minutes to try to figure out how to get a simple application out. <a href="http://www.codeplex.com/FacebookToolkit/Release/ProjectReleases.aspx?ReleaseId=13985">The documentation posted here</a> is a bit outdated so let me post my own little how-to. They’ve actually made it a lot easier but the new API needs a bit of getting used to I guess. It’s a bit confusing as the APIs for CanvasFBMLBasePage is different from CanvasIFrameBasePage. I hope they standardize soon though. Considering that this is supposedly an RC, it doesn’t seem like they’ve settled on a convention yet.</p>
<p>So again, assumption is:</p>
<p>1. You’re using C# as your language</p>
<p>2. You’re building an app with the CanvasFBMLBasePage (haven’t tried out the Master Page yet.. baby steps my friend)</p>
<p>1. Visit <a href="http://www.facebook.com/developers">http://www.facebook.com/developers</a> and <a href="http://www.new.facebook.com/developers/editapp.php?new">Setup A New Application</a>. Expand the optional fields and set up your application, making sure you have the following details filled in:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image3.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="592" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb2.png" width="611" border="0"></a> </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image4.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="90" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb3.png" width="482" border="0"></a> </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image5.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="132" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb4.png" width="518" border="0"></a> </p>
<p>2. Once you have successfully set this up, take note of your API Key and Secret:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image6.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="89" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb5.png" width="230" border="0"></a> </p>
<p>3. Fire up Visual Studio 2008 and set up a new ASP.NET Web Application</p>
<p>4. Open up Default.aspx and remove everything but the first line (which is the page directive that says tells .NET which is the CodeFile. Your default.aspx should look something like this:</p>
</p>
</p>
<pre class="code"><span style="background: #ffee62">&lt;%</span><span style="color: blue">@ </span><span style="color: #a31515">Page </span><span style="color: red">Language</span><span style="color: blue">="C#" </span><span style="color: red">AutoEventWireup</span><span style="color: blue">="true"  </span><span style="color: red">CodeFile</span><span style="color: blue">="Default.aspx.cs" </span><span style="color: red">Inherits</span><span style="color: blue">="_Default" </span><span style="background: #ffee62">%&gt;
</span><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">label </span><span style="color: red">ID</span><span style="color: blue">="Content" </span><span style="color: red">runat</span><span style="color: blue">="server" </span><span style="color: red">text</span><span style="color: blue">="Label"&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">label</span><span style="color: blue">&gt;
</span></pre>
<p>// For convenience, I added an asp.net label control where I would write out the <a href="http://wiki.developers.facebook.com/index.php/FBML">FBML</a> later on. If you’d rather use Response.Write() you could do that as well. Then you wouldn’t need to have the second line on Default.aspx</p>
</p>
</p>
</p>
</p>
<p>5. Before we dig into the CS files, we’ll need to add a reference to the <a href="http://www.codeplex.com/FacebookToolkit/Release/ProjectReleases.aspx?ReleaseId=13985">facebook dlls that we can download from codeplex</a>. Simply select to download bin.zip and it should give you the dlls necessary for you to build a Facebook app. Unzip this in a location you can easily find. Go to your Solution Explorer and right-click on your project –&gt; Add Reference</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image7.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb6.png" width="220" border="0"></a> </p>
<p>Click on the Browse tab and navigate to where you extracted the binaries for the toolkit. You will want to add a reference to both facebook.dll and facebook.web.dll //yes, the non-caps irks me too.. wait till you see the classes *sigh*</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image8.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="412" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb7.png" width="483" border="0"></a> </p>
<p>When you finish adding these two necessaries, it’ll pull some other files along for the ride as well so don’t be surprised about that. </p>
<p>6. Now that’s finished, we can open up our .CS file and start by importing the necessary namespaces namely:</p>
<pre class="code"><span style="color: blue">using </span>facebook;
<span style="color: blue">using </span>facebook.web;</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>and then, make our class inherit from the CanvasFBMLBasePage class that is part of the toolkit. This base class should take care of all the nitty gritties of dealing with Facebook and making sure it knows who you are (or in this case, your application)</p>
<pre class="code"><span style="color: blue">public partial class </span><span style="color: #2b91af">_Default </span>: <span style="color: #2b91af">CanvasFBMLBasePage
</span>{
    <span style="color: blue">protected void </span>Page_Load(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
    {

    }
}</pre>
<pre class="code">&nbsp;</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>7. Before we proceed, lets add a snippet to our web.config file to set our APIKEY and secret. The base class will be looking at our web.config file for the values to use to authenticate with Facebook. All you need to do is find this section:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image9.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="96" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb8.png" width="240" border="0"></a> </p>
<p>and replace it with something like:</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">appSettings</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">add </span><span style="color: red">key</span><span style="color: blue">=</span>"<span style="color: blue">APIKey</span>" <span style="color: red">value </span><span style="color: blue">=</span>"<span style="color: blue">8e38f5fc72b989b8146dc91ece7e9b6a</span>"<span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">add </span><span style="color: red">key</span><span style="color: blue">=</span>"<span style="color: blue">Secret</span>" <span style="color: red">value </span><span style="color: blue">=</span>"<span style="color: blue">d9a5bd957d3aa1c69316839f1543fce0</span>"<span style="color: blue">/&gt;
&lt;/</span><span style="color: #a31515">appSettings</span><span style="color: blue">&gt;</span></pre>
<p>of course put in the APIKey and Secret that was provided to you by Facebook. Don’t go using my key, it won’t work with your URL anyway <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Make sure you SAVE!</p>
<p>8. Going back to Default.aspx.cs, we can now proceed to add logic to our application.</p>
<pre class="code"><span style="color: blue">protected void </span>Page_Load(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
{
    <span style="color: blue">base</span>.Page_Init(sender, e); // this is the code that will call the base</pre>
<pre class="code">                               // methods that deal with authenticating </pre>
<pre class="code">                               // with facebook and all that mumbo jumbo</pre>
<pre class="code">&nbsp;</pre>
<blockquote><pre class="code"><span style="color: blue">if</span>(!IsPostBack)    {
    stringuid = <span style="color: blue">base</span>.API.uid.ToString(); <span style="color: green">// this is the code to retrieve</span></pre>
<pre class="code"><span style="color: green">                                          // the userid of the logged in user </span></pre>
<pre class="code"><span style="color: green">                                          //(the person accessing your application</span></pre>
<pre class="code">   Content.Text = <span style="color: #a31515">"&lt;fb:profile-pic uid='" </span>+ uid + <span style="color: #a31515">"'/&gt;"</span>;               // You can also do something </pre>
<pre class="code">   Content.Text+= <span style="color: #a31515">"hello, &lt;fb:name uid='"</span>+ uid + <span style="color: #a31515">"' useyou='false'/&gt;"</span>; // like Response.Write( </pre>
<pre class="code">                                                                       // <span style="color: #a31515">"&lt;fb:profile-pic uid='" </span>+</pre>
<pre class="code">                                                                       // uid + <span style="color: #a31515">"'/&gt;"</span>); for this part</pre>
<pre class="code">   Content.Text += <span style="color: #a31515">" you have "</span>+ <span style="color: blue">base</span>.API.friends.get().Count + <span style="color: #a31515">" friends so far "</span>; </pre>
<pre class="code">   <span style="color: green">//anything you need to know about your user, you will find from base.API – all your base are belong to us</span></pre>
<p><a href="http://11011.net/software/vspaste"></a>
<pre class="code">

<a href="http://11011.net/software/vspaste"></a>}}</pre>
</blockquote>
<p>9. Once that’s done, we can now go and publish our application by right-clicking on the project in solution explore and selecting publish</p>
<p>&nbsp;<a href="http://aimeegurl.com/wp-content/uploads/2008/08/image10.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="216" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb9.png" width="266" border="0"></a> </p>
<p>Make sure you are publishing to the Callback URL you specified when you applied for the Application Key and Secret. </p>
<p>10. When you’re done publishing and you try to access the application, you should see something like this:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image11.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="349" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb10.png" width="755" border="0"></a> </p>
<p>and when you click allow, you’ll get:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/08/image12.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="211" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/08/image-thumb11.png" width="518" border="0"></a> </p>
<p>Some issues I noticed though is that when I try to access the application URL when I am logged out, Facebook tells me that the page cannot be found. But when I access it when I’m already logged in, it’ll prompt me to allow the application to access my information if i have not yet added the app. I’m checking with the forum on codeplex to see whether this is a Facebook issue or whether it’s the Tool&#8217;kit’s</p>
<p>Congratulations! You have now built your first FBML based Facebook application! Will let you know how far I go with this new framework.</p>
<p>It seems to be cleaner code right now, but I guess I’ll need to fool around with this to find out more. </p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2008/08/27/using-the-facebook-developer-toolkit-20-for-canvas-based-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mix for Students: facebook development on .NET</title>
		<link>http://aimeegurl.com/2008/07/26/mix-for-students-facebook-development-on-net/</link>
		<comments>http://aimeegurl.com/2008/07/26/mix-for-students-facebook-development-on-net/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 11:03:40 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Code Bits]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2008/07/26/mix-for-students-facebook-development-on-net/</guid>
		<description><![CDATA[I did a session on facebook development using the facebook developer toolkit where I also showed how I integrated my Piss Off Silverlight application into a facebook app, which I now call PissBook. I’ve registered the pissbook url but have yet to point it to my app as it seems that facebook isn’t allowing me [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>I did a session on facebook development using the <a href="http://www.codeplex.com/FacebookToolkit">facebook developer toolkit</a> where I also showed how I integrated my <a href="http://innovativesingapore.com/blogs/jocelyn/archive/2008/07/02/bored-to-death.aspx">Piss Off</a> Silverlight application into a facebook app, which I now call <a href="http://apps.facebook.com/pissbook">PissBook</a>.<strike> I’ve registered the pissbook url but have yet to point it to my app as it seems that facebook isn’t allowing me to save it as “addable” on facebook <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </strike>&#160; I forgot to put in the post add URL ^_^</p>
<p>&#160;<a href="http://aimeegurl.com/wp-content/uploads/2008/07/image5.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="118" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb4.png" width="480" border="0" /></a> </p>
<p>What I did was take this silverlight app:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image6.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="568" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb5.png" width="487" border="0" /></a> </p>
<p>And showed how you can make it work with data from facebook (or any other datasource for that matter). If you are using the default page generated by the Silverlight project, you would have something like:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image7.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="48" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb6.png" width="457" border="0" /></a> </p>
<p>on the Page_Load event, you should then be able to add values from your Request variable, in this case the logged in user name, and the friend’s name which i picked up from facebook’s friend-selector component, and pass these as InitParameters to my Silverlight Application.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image8.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="204" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb7.png" width="422" border="0" /></a>     <br />I then needed to do a bit of tweaking in my App.xaml file on the Application_Startup method where I parsed the initialization Parameters and passed it to the constructor on my Page user control, which is basically my Silverlight application.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image9.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="311" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb8.png" width="467" border="0" /></a> </p>
<p>I then created a new constructor for my Page.xaml, which is more or less the same as the original one, except this accepts some parameters and assigns them to the textboxes in my application:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image10.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="245" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb9.png" width="462" border="0" /></a> </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image11.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="282" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb10.png" width="469" border="0" /></a> </p>
<p>A simple application but it basically shows you how you can integrate your Silverlight applications with dynamic datasources through its InitParams property.</p>
<p>&#160;</p>
<p><a href="http://apps.facebook.com/facebooksession"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="541" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image12.png" width="494" border="0" /></a> </p>
<p>Code and slides are here:</p>
<p><iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 26px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedrow.aspx/Presentations/Mix%20For%20Students" frameborder="0" scrolling="no"></iframe></p>
<p>* NOTE: for some reason, when you’re not logged in, facebook gives a 404 when i try to access the app directly from <a href="http://apps.facebook.com/facebooksession">http://apps.facebook.com/facebooksession</a> I’ll update this as soon as I find out a resolution.</p>
<p>this is apparently a 6-month old bug <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  <a title="http://bugs.developers.facebook.com/show_bug.cgi?id=1406" href="http://bugs.developers.facebook.com/show_bug.cgi?id=1406">http://bugs.developers.facebook.com/show_bug.cgi?id=1406</a> still unresolved.</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2008/07/26/mix-for-students-facebook-development-on-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed a font</title>
		<link>http://aimeegurl.com/2008/07/25/embed-a-font/</link>
		<comments>http://aimeegurl.com/2008/07/25/embed-a-font/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 09:05:15 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Code Bits]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2008/07/25/embed-a-font/</guid>
		<description><![CDATA[If you want to embed a font into your Silverlight applications, add the font into your project: Set the Build Action file property to embedded resource: Use the following code snippet to use the font as a font source for your components: Assembly ass = Assembly.GetExecutingAssembly(); Stream stream = ass.GetManifestResourceStream(&#34;EmbeddedResource.Font.pricedow.ttf&#34;); this.test.FontSource = new FontSource(stream); this.test.FontFamily [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>If you want to embed a font into your Silverlight applications, add the font into your project:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image2.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="178" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb1.png" width="174" border="0" /></a> </p>
<p>Set the Build Action file property to embedded resource:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image3.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="251" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb2.png" width="263" border="0" /></a> </p>
<p>Use the following code snippet to use the font as a font source for your components:</p>
<pre class="code"><span style="color: #2b91af">Assembly </span>ass = <span style="color: #2b91af">Assembly</span>.GetExecutingAssembly();
<span style="color: #2b91af">Stream </span>stream =</pre>
<pre class="code">ass.GetManifestResourceStream(<span style="color: #a31515">&quot;EmbeddedResource.Font.pricedow.ttf&quot;</span>);
<span style="color: blue">this</span>.test.FontSource = <span style="color: blue">new </span><span style="color: #2b91af">FontSource</span>(stream);
<span style="color: blue">this</span>.test.FontFamily = <span style="color: blue">new </span><span style="color: #2b91af">FontFamily</span>(<span style="color: #a31515">&quot;Pricedown&quot;</span>);</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>XAML looking something like:</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">Grid </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;LayoutRoot&quot; </span><span style="color: red">Background</span><span style="color: blue">=&quot;White&quot;&gt;
    &lt;</span><span style="color: #a31515">Canvas</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;test&quot; </span><span style="color: red">FontFamily</span><span style="color: blue">=&quot;annifont.ttf#Annifont&quot; </span></pre>
<pre class="code"><span style="color: red">         Text</span><span style="color: blue">=&quot;grand theft auto IV&quot; </span><span style="color: red">FontSize</span><span style="color: blue">=&quot;30&quot;/&gt;
    &lt;/</span><span style="color: #a31515">Canvas</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Grid</span><span style="color: blue">&gt;</span></pre>
<p>And the result:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2008/07/image4.png"><img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="205" alt="image" src="http://aimeegurl.com/wp-content/uploads/2008/07/image-thumb3.png" width="354" border="0" /></a></p>
<p>Source: </p>
<p><iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:26px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedrow.aspx/Projects/EmbeddedResource.zip"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2008/07/25/embed-a-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

