<?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>Lim Guo Hong &#187; C#</title>
	<atom:link href="http://www.limguohong.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.limguohong.com</link>
	<description>Technology Enthusiast</description>
	<lastBuildDate>Fri, 11 Nov 2011 03:11:33 +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>Remove Title Bar from your WPF application</title>
		<link>http://www.limguohong.com/2011/05/remove-title-bar-from-your-wpf-application/</link>
		<comments>http://www.limguohong.com/2011/05/remove-title-bar-from-your-wpf-application/#comments</comments>
		<pubDate>Thu, 05 May 2011 15:13:33 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code behind]]></category>
		<category><![CDATA[remove title bar]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[title bar]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=605</guid>
		<description><![CDATA[Recently, one of my friends was asking me how can him remove the title bar from his WPF Application. He dont know what the keyword he can use, I thought its interesting so I am posting here so in case if any one needs it in the future. There are a few ways to do [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, one of my friends was asking me how can him remove the title bar from his WPF Application. He dont know what the keyword he can use, I thought its interesting so I am posting here so in case if any one needs it in the future.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/05/WPF-Title-Bar.jpg"><img src="http://www.limguohong.com/wp-content/uploads/2011/05/WPF-Title-Bar.jpg" alt="" title="WPF Title Bar" width="600" height="450" class="alignnone size-full wp-image-610" /></a></p>
<p>There are a few ways to do it.<br />
1. Do through coding ( Code Behind ).</p>
<blockquote><p>this.WindowStyle = WindowStyle.None;</p></blockquote>
<p>2. Do through XAML. Add in the <em>WindowStyle</em> attribute to the <em>Window</em> Tag<br />
<code>Window WindowStyle="None"&gt;</code></p>
<p>3. Editing through the properties ( Ultimately, this changes the XAML )<br />
<div id="attachment_607" class="wp-caption alignnone" style="width: 212px"><a href="http://www.limguohong.com/wp-content/uploads/2011/05/Properties.png"><img src="http://www.limguohong.com/wp-content/uploads/2011/05/Properties.png" alt="Properties" title="Properties" width="202" height="428" class="size-full wp-image-607" /></a><p class="wp-caption-text">Properties</p></div></p>
<p>You can check out the sample application here.<br />
<a href="http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Code%20Guide/Windows%20Presentation%20Foundation/RemoveTitleBarWPF.zip">http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Code%20Guide/Windows%20Presentation%20Foundation/RemoveTitleBarWPF.zip</a></p>
<p>If you have any questions, please feel free to contact me at guohong@limguohong.com</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/05/remove-title-bar-from-your-wpf-application/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/05/remove-title-bar-from-your-wpf-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting theme on Windows Phone 7</title>
		<link>http://www.limguohong.com/2011/04/detecting-theme-on-windows-phone-7/</link>
		<comments>http://www.limguohong.com/2011/04/detecting-theme-on-windows-phone-7/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 09:41:24 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[dark]]></category>
		<category><![CDATA[detecting theme]]></category>
		<category><![CDATA[finding out]]></category>
		<category><![CDATA[knowing]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[windows phone]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=520</guid>
		<description><![CDATA[This blog post is going to teach you how do we detect if we are on dark or light theme on Windows Phone 7. I realised that this will be useful because I have quite some friends who are asking me about it because they didn&#8217;t get the right resources online. If you happened to [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post is going to teach you how do we detect if we are on dark or light theme on Windows Phone 7. I realised that this will be useful because I have quite some friends who are asking me about it because they didn&#8217;t get the right resources online. If you happened to come across a resource that asks you to get from App.xaml, that doesnt work anymore as its removed after the RC build.</p>
<p>Based on <a href="http://msdn.microsoft.com/en-us/library/ff769552(v=VS.92).aspx">Theme Resources for Windows Phone</a>, under <strong><em>Theme Visibility and Opacity</em></strong>.<br />
By checking Resources, I am able to check if its Visible or Collapsed for the dark or White theme by doing this</p>
<blockquote><p>Visibility isLight = (Visibility)Resources["PhoneLightThemeVisibility"]; // for light theme<br />
Visibility isDark = (Visibility)Resources["PhoneDarkThemeVisibility"]; // for dark theme</p></blockquote>
<p>Then we use if else to check,</p>
<blockquote><p>if (isLight == System.Windows.Visibility.Visible)<br />
{<br />
//We are on light theme<br />
}</p></blockquote>
<p>Light Theme</p>
<p>or </p>
<blockquote><p>if (isDark == System.Windows.Visibility.Visible)<br />
{<br />
//We are on dark theme<br />
}</p></blockquote>
<p>Dark Theme</p>
<p>Attached is a sample code to show how do I detect Windows Phone 7 theme, before the Mango buuild ( I am unsure if there is a change after Mango ).<br />
<a href="http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Code%20Guide/Windows%20Phone%207/DetectTheme.zip">Detect Theme on Windows Phone 7 Sample</a></p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/04/detecting-theme-on-windows-phone-7/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/04/detecting-theme-on-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Back Button on Windows Phone 7</title>
		<link>http://www.limguohong.com/2011/01/how-to-use-back-button-on-windows-phone-7/</link>
		<comments>http://www.limguohong.com/2011/01/how-to-use-back-button-on-windows-phone-7/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 16:15:35 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[back button]]></category>
		<category><![CDATA[Pressing the Back button from the first screen of an application must exit the application.]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=459</guid>
		<description><![CDATA[Credit to Steven, http://www.sticapac.com for allowing me to post this up on my blog. Recently, I worked on an app for the Windows Phone 7 platform and submitted it to the marketplace for certification. I’ve learnt many things and gained many insights after going through this process and would like to share one of these [...]]]></description>
			<content:encoded><![CDATA[<p><em>Credit to Steven, <a href="http://www.sticapac.com">http://www.sticapac.com</a> for allowing me to post this up on my blog.</em></p>
<p>Recently, I worked on an app for the Windows Phone 7 platform and submitted it to the marketplace for certification. I’ve learnt many things and gained many insights after going through this process and would like to share one of these with you, developers and potential developers of the Windows Phone 7 platform.</p>
<p>Throughout this post, I will be making references to the official <strong>Windows Phone 7 Application Certification Requirements</strong> document (WP7ACR) which can be downloaded at<a href="http://go.microsoft.com/?linkid=9730558">http://go.microsoft.com/?linkid=9730558</a>.</p>
<p>Under Section 5.2.4 of the WP7ACR, clause a, it is stated that:</p>
<blockquote><p>Pressing the Back button from the first screen of an application must exit the application.</p></blockquote>
<p>Developers who are creating apps with multiple pages must give special attention to this clause because pressing the back button automatically brings the user to the previous page, regardless of whether the user is at the first screen or not. Consider the following example:</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/01/Diagram1.png"><img src="http://www.limguohong.com/wp-content/uploads/2011/01/Diagram1.png" alt="" title="Diagram1" width="467" height="118" class="alignnone size-full wp-image-460" /></a></p>
<p>In this app, there are 2 pages. Page1 goes to Page2 via a button with the following logic:</p>
<blockquote><p>NavigationService.Navigate(new Uri(“/Page2.xaml”, UriKind.Relative));</p></blockquote>
<p>Page2 goes back to Page1 via a button with the following logic:</p>
<blockquote><p>NavigationService.Navigate(new Uri(“/Page1.xaml”, UriKind.Relative));</p></blockquote>
<p>Each time that line of code is executed, it is actually creating a new instance of the page defined under the new Uri. Therefore if the user navigates in this manner:</p>
<ol>
<li>User starts the app.</li>
<li>User navigates to Page2 via button.</li>
<li>User navigates to Page1 via button.</li>
</ol>
<p>At this point in time, the user is at the first page of the application. If the user presses the <strong>back button</strong>, he will be brought back to Page2 instead of exiting the app, which is wrong and will result in a failure of the certification process.</p>
<p>There is no API in the Windows Phone 7 SDK similar to the Application.Exit() function found in the average C#.NET Windows Forms application. For this reason, we must overcome this problem by navigation by page hierarchy. That is to say, when the user navigates from Page2 to Page1 via the button, instead of treating Page1 as a new page, the developer should instead use this line of code for the navigation purpose from Page2 back to Page1:</p>
<blockquote><p>NavigationService.GoBack();</p></blockquote>
<p>By doing this, the developer is essentially coding the button to function exactly like what the back button does on the Windows Phone. In this way, the app will always exit when the back button is pressed on the first page because the first page is always the only record under the action history when the user is on the first page. The diagram will then look like this:</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/01/Diagram2.png"><img src="http://www.limguohong.com/wp-content/uploads/2011/01/Diagram2.png" alt="" title="Diagram2" width="284" height="118" class="alignnone size-full wp-image-461" /></a></p>
<p>Therefore we have successfully adhered to Section 5.2.4 of the WP7ACR, clause a. This is how we can effectively use the Back button and pass certification for functions relating to the back button.</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/01/how-to-use-back-button-on-windows-phone-7/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/01/how-to-use-back-button-on-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 7 Workshop</title>
		<link>http://www.limguohong.com/2010/01/windows-7-workshop/</link>
		<comments>http://www.limguohong.com/2010/01/windows-7-workshop/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 16:59:51 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[expression blend]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=399</guid>
		<description><![CDATA[Met YangLin, Pratibha, Eugene and Alex there while I attend the Windows 7 Development workshop at SMU organised by SG Acad Team, MS Singapore. I have been following Jocelyn Villaraza&#8216;s blog but never had a chance to see her in action and today, finally, i had. Pretty good presentation done by her. I am gonna [...]]]></description>
			<content:encoded><![CDATA[<p>Met YangLin, Pratibha, Eugene and Alex there while I attend the Windows 7 Development workshop at SMU organised by SG Acad Team, MS Singapore. I have been following <a href="http://aimeegurl.com">Jocelyn Villaraza</a>&#8216;s blog but never had a chance to see her in action and today, finally, i had. Pretty good presentation done by her.</p>
<p>I am gonna rewrite one of her guide for my school&#8217;s bootcamp. Hope to get it done when I am free next week ( After Monday ). I never knew that program was so cool.</p>
<p>Going to teach wushu tomorrow morning!</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2010/01/windows-7-workshop/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2010/01/windows-7-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What programs to write?</title>
		<link>http://www.limguohong.com/2008/10/what-programs-to-write/</link>
		<comments>http://www.limguohong.com/2008/10/what-programs-to-write/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 18:18:50 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=222</guid>
		<description><![CDATA[I am too addicted to facebook now? Guo Hong now wants to write some simple application using C# but not sure what he can write.]]></description>
			<content:encoded><![CDATA[<p>I am too addicted to facebook now?</p>
<p><strong>Guo Hong</strong> now wants to write some simple application using C# but not sure what he can write.</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2008/10/what-programs-to-write/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2008/10/what-programs-to-write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I will be doing next?</title>
		<link>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/</link>
		<comments>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 19:14:51 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mangakey]]></category>
		<category><![CDATA[references]]></category>
		<category><![CDATA[to-do-list]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=220</guid>
		<description><![CDATA[Seems like its about 90% done. I am looking to do a full HTML or CSS reference and tutorial website once I am done with my current website and promotion. I have a few domains to use. To do list: -Upgrade my blog&#8217;s script -C# boot camp #2 / #3 ( Its lying in my [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like its about 90% done.</p>
<p>I am looking to do a full HTML or CSS reference and tutorial website once I am done with my current website and promotion.</p>
<p>I have a few domains to use.</p>
<p>To do list:<br />
-Upgrade my blog&#8217;s script<br />
-C# boot camp #2 / #3 ( Its lying in my admin panel for very long already. )<br />
-Disclaimer and About Me page.<br />
-Clear up unused domains in my cPanel<br />
-Clear up unused MySQL in my cPanel</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2008/10/what-i-will-be-doing-next/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Boot Camp ( Part 1)</title>
		<link>http://www.limguohong.com/2008/09/c-boot-camp-part-1/</link>
		<comments>http://www.limguohong.com/2008/09/c-boot-camp-part-1/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 17:10:27 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[temasek]]></category>
		<category><![CDATA[MSC]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=214</guid>
		<description><![CDATA[What is C#? ( Wiki to what is C# ) Anyway it was fun. 3 letters to summarise the whole UX ( User Experience ). Haha This maybe useful for me in the future. //This is how to comment in C# //This is how to make a message box come out, Message.Show //(CONTENT OF MESSAGE [...]]]></description>
			<content:encoded><![CDATA[<p>What is C#? ( <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">Wiki to what is C#</a> )</p>
<p>Anyway it was fun. 3 letters to summarise the whole UX ( User Experience ). Haha</p>
<p>This maybe useful for me in the future.<br />
<code>//This is how to comment in C#<br />
//This is how to make a message box come out, Message.Show<br />
//(CONTENT OF MESSAGE BOX, TITLE OF THE MESSAGE BOX)<br />
Message.Show("Guo Hong", "Title")</code></p>
<p>In php, to add things on to a string variable, we do<br />
<code>$des = "Guo Hong is ";<br />
$des .= "handome.";</code></p>
<p>but in C#,<br />
<code>string des = "Guo Hong is ";<br />
des += "handome.";</code></p>
<p>Notice the += and .= ?</p>
<p>Haha, hopefully tomorrow will be more interesting! <img src='http://www.limguohong.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2008/09/c-boot-camp-part-1/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2008/09/c-boot-camp-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

