<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <channel>
    <title>WindowsPhoneGeek Tips &amp; Tricks</title>
    <link>http://www.windowsphonegeek.com/tips-feed</link>
    <description>windowsphonegeek.com Tips &amp; Tricks feed</description>
    <language>en-us</language>
    <pubDate>2011-01-05T00:13:48.0000000+02:00</pubDate>
    <lastBuildDate>5/21/2012 6:34:54 PM</lastBuildDate>
    <generator>N2 CMS</generator>
    <managingEditor>windowsphonegeek.com</managingEditor>
    <item>
      <title>Implementing Confirm on exit in Windows Phone</title>
      <link>http://www.windowsphonegeek.com/tips/Implementing-Confirm-on-exit-in-Windows-Phone</link>
      <description>&lt;p&gt;by &lt;a href="/UserProfile/View?userName=DiAbLoxx83" target="_blank"&gt;DiAbLoxx83&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this post I will show how to create a simple function for ask confirm on exit application.&lt;/p&gt;  &lt;p&gt;&lt;a href="/upload/articles/ConfirmOnExit_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ConfirmOnExit" border="0" alt="ConfirmOnExit" src="/upload/articles/ConfirmOnExit_thumb.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; You need to create a function for clear navigation history:&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;private void ClearBackEntries()
{
    while (NavigationService.BackStack != null &amp;amp; NavigationService.BackStack.Count() &amp;gt; 0)
        NavigationService.RemoveBackEntry();
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: in Markeplace there are many applications with an annoying problem when you try exit from main page: you have to navigate all visited pages. With this function you can solve the problem.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; You need to manage the phone BackKeyPress event in your MainPage.xaml&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
    // TO DO
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Insert a MessageBox dialog and use stop back event when the user don't want exit the application&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;if (MessageBox.Show(&amp;quot;Are you sure?&amp;quot;, &amp;quot;Exit?&amp;quot;, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
this.ClearBackEntries();
   else
e.Cancel = true;&lt;/pre&gt;

&lt;p&gt;Here is the full source code &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:793705b0-a691-451b-be5d-5ae9c4cd74f1" class="wlWriterSmartContent"&gt;
  &lt;p&gt;&lt;a href="/upload/articles/ConfirmOnExit.zip" target="_blank"&gt;ConfirmOnExit.zip&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</description>
      <pubDate>2012-05-09T11:33:46.0000000+03:00</pubDate>
    </item>
    <item>
      <title>The missing  [NeutralResourceLanguage] attribute error in Windows Phone marketplace</title>
      <link>http://www.windowsphonegeek.com/tips/The-missing--NeutralResourceLanguage-attribute-error-in-Windows-Phone-marketplace</link>
      <description>&lt;p&gt;by &lt;a href="http://www.windowsphonegeek.com/UserProfile/View?userName=isenthil"&gt;Senthil Kumar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When submitting one of my Apps (&lt;a href="http://www.windowsphone.com/en-US/apps/1110c5a7-0f99-e011-986b-78e7d1fa76f8"&gt;Number Converter for Windows Phone&lt;/a&gt;) to the Windows Phone Marketplace, I got this error when uploading my .XAP file&lt;/p&gt;
&lt;p&gt;&lt;a name="_GoBack" href="http://www.windowsphonegeek.com/upload/tips/clip_image002_2_1.jpg"&gt;&lt;img style="padding-right: 0px; display: inline; padding-left: 0px; background-image: none; margin: 0px; padding-top: 0px; border-width: 0px;" title="clip_image002" src="http://www.windowsphonegeek.com/upload/tips/clip_image002_thumb_1.jpg" border="0" alt="clip_image002" width="244" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The [NeutralResourceLanguage] attribute is missing on the entry assembly. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When searched for this error in Google, I found out that the cause of the error is the wrong NeutralResourceLanguage set in the Windows Phone Project.&lt;/p&gt;&lt;p&gt;The NeutralResourceLanguage was set to "None" and this caused the error.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/clip_image004_2_1.jpg"&gt;&lt;img style="padding-right: 0px; display: inline; padding-left: 0px; background-image: none; margin: 0px; padding-top: 0px; border-width: 0px;" title="clip_image004" src="http://www.windowsphonegeek.com/upload/tips/clip_image004_thumb_1.jpg" border="0" alt="clip_image004" width="244" height="243" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To resolve the error, one needs to set the NeutralResourceLanguage to English.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/clip_image006_2.jpg"&gt;&lt;img style="padding-right: 0px; display: inline; padding-left: 0px; background-image: none; margin: 0px; padding-top: 0px; border-width: 0px;" title="clip_image006" src="http://www.windowsphonegeek.com/upload/tips/clip_image006_thumb.jpg" border="0" alt="clip_image006" width="244" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>2012-03-26T22:11:08.0000000+03:00</pubDate>
    </item>
    <item>
      <title>Windows Phone 7 Text Style Picker Control</title>
      <link>http://www.windowsphonegeek.com/tips/Windows-Phone-7-Text-Style-Picker-Control</link>
      <description>&lt;p&gt;by &lt;a href="http://www.windowsphonegeek.com/UserProfile/View?userName=khk"&gt;KHK&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It looks like the off-the-shelf WP7 SDK, the &lt;a href="http://silverlight.codeplex.com/releases/view/75888"&gt;Silverlight SDK&lt;/a&gt;, and even the &lt;a href="http://coding4fun.codeplex.com"&gt;Coding4Fun&lt;/a&gt; suite lack one very basic piece of functionality that you may want to provide your WP7 app users with: selecting the font style (family, bold, italic), color and size. &lt;/p&gt;  &lt;p&gt;Since I needed something like that myself, I thought: why won't I just pack it and share with the fellow developers? ;-) &lt;/p&gt;  &lt;p&gt;So, here it is: &lt;a href="http://wp7textstylepicker.codeplex.com/"&gt;http://wp7textstylepicker.codeplex.com/&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsphonegeek.com/upload/articles/ScreenDarkS_2.png"&gt;&lt;img title="ScreenDarkS" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px 10px 0px 20px; padding-top: 0px; border-right-width: 0px" height="244" alt="ScreenDarkS" src="http://windowsphonegeek.com/upload/articles/ScreenDarkS_thumb.png" width="148" border="0" /&gt;&lt;/a&gt;&lt;a href="http://windowsphonegeek.com/upload/articles/ScreenLightS_2.png"&gt;&lt;img title="ScreenLightS" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="ScreenLightS" src="http://windowsphonegeek.com/upload/articles/ScreenLightS_thumb.png" width="148" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Documentation, source code and sample app illustrating the usage of the control are available at the CodePlex page.&lt;/p&gt;  &lt;p&gt;Any feedback (feature requests, constructive critics, or unconcealed flattery), as well as rating the control and spreading the word, will be sincerely appreciated! :-)&lt;/p&gt;</description>
      <pubDate>2012-03-16T15:59:58.0000000+02:00</pubDate>
    </item>
    <item>
      <title>Windows Phone App Development for Beginners #7 TextBlock control</title>
      <link>http://www.windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-7-TextBlock-control</link>
      <description>&lt;p&gt;by WindowsPhoneGeek&lt;/p&gt;  &lt;p&gt;This is the 7th post&amp;#160; from the &amp;quot;&lt;em&gt;Windows Phone Application Development for Beginners&lt;/em&gt;&amp;quot; series of articles in which I use a more informal approach in order to explain everything you need to know in order to get started developing Windows Phone applications in a simple and easy to understand way.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-1-Intro"&gt;Windows Phone App Development for Beginners #1: Intro&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-2-Installing-the-Tools"&gt;Windows Phone App Development for Beginners #2 Installing the Tools&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-3-Getting-Help"&gt;Windows Phone App Development for Beginners #3 Getting Help&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-4-First-Visual-Studio-project"&gt;Windows Phone App Development for Beginners #4 First Visual Studio project&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-5-Basic-XAML"&gt;Windows Phone App Development for Beginners #5 Basic XAML&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-6-Layout"&gt;Windows Phone App Development for Beginners #6 Layout&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Windows Phone App Development for Beginners #7 TextBlock control &lt;/strong&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;&lt;em&gt;NOTE&lt;/em&gt;: If you are a professional Windows Phone Developer you should probably stop reading now - &lt;em&gt;this series is for absolute beginners.&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In short to create Windows Phone application User Interface in addition to layout panels you use controls as well, such as buttons,checkboxes, shapes, text, and other content presented on the screen. Every Control element is reusable and can be customized by setting different value to its properties (For reference take a look at &lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-5-Basic-XAML"&gt;Windows Phone App Development for Beginners #5 Basic XAML&lt;/a&gt; ).&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;TextBlock Control&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;TextBlock is a control that usually is used for displaying small amounts of text.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step1.&lt;/strong&gt; To start using the TextBlock, go to the Toolbox window and drag a TextBlock element into the design surface.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: The &amp;quot;Toolbox&amp;quot; tab should be on the right side in your&amp;#160; Visual studio project. If for some reason you can not find it, then you can go to the Visual Studio menu and select View-&amp;gt;Toolbox as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_29.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="29" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_13_1_2_3.png" width="103" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_6_1_2_3_4_5_6_7_8_9_10_11.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="204" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_2_1_2_3_4_5_6_7_8_9_10_11.png" width="302" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step2. &lt;/strong&gt;If you want to see the generated XAML code then just go to XAML view as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_14_1_2_3_4_5.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; border-right-width: 0px" height="204" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_6_1_2_3_4_5_6.png" width="368" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_12_1_2_3_4_5_6.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="49" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_5_1_2_3_4_5_6.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step3. &lt;/strong&gt;Right click the button element in the design surface and select &amp;quot;Properties&amp;quot; from the context menu. The &amp;quot;Properties&amp;quot; panel will open from where you can change different settings of your button:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_16_1_2_3_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_7_1_2_3_4.png" width="232" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_18_1_2_3.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_8_1_2_3.png" width="204" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step4.&lt;/strong&gt; Here is how the TextBlock control looks like on a Emulator or real device:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_35.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="213" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_16.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step5.&lt;/strong&gt; Key properties that you may need to use when developing your app:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Text : via this property you set the displayed text &lt;/li&gt;    &lt;li&gt;TextWrapping : via this property you set whether or not the text to be wrapped (Wrap or NoWrap). By default the text is not wrapped. &lt;/li&gt;    &lt;li&gt;Foreground &lt;/li&gt;    &lt;li&gt;Background &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: You can set different properties values either via the visual designer using the properties window, or directly typing into the XAML/C# code.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: For more information you can also take a look at the official MSDN Documentation: &lt;a href="http://go.microsoft.com/fwlink/?LinkId=206555"&gt;TextBlock&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That's it for now.&amp;#160; &lt;/p&gt;  &lt;p&gt;I hope the post was helpful.&lt;/p&gt;</description>
      <pubDate>2012-03-16T13:55:02.0000000+02:00</pubDate>
    </item>
    <item>
      <title>Implement Sharing to Facebook, Twitter in Windows Phone</title>
      <link>http://www.windowsphonegeek.com/tips/Implement-Sharing-to-Facebook--Twitter-in-Windows-Phone</link>
      <description>&lt;p&gt;by Kate Brown&lt;/p&gt;  &lt;p&gt;In this quick tip I will demonstrate how easy it is to implement Twitter and Facebook sharing when developing for Windows Phone. In fact many people think that it is hard and time consuming implementation but there is a pretty fast and simple alternative using the new aditional launchers that came with Windows Phone Mango.&lt;/p&gt;  &lt;p&gt;So the easiest way to add Twitter and Facebook share buttons is to use the &lt;em&gt;ShareLinkTask&lt;/em&gt; class. This class allows your Windows Phone&amp;#160; application to launch a dialog that enables the user to share a link on the social networks (of their choice). All you need to do is to use the following code:&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = &amp;quot;Article Title&amp;quot;;
shareLinkTask.LinkUri = new Uri(&amp;quot;http://www.microsoft.com&amp;quot;, UriKind.Absolute);
shareLinkTask.Message = &amp;quot;Some Message to be shared&amp;quot;; 
shareLinkTask.Show();&lt;/pre&gt;

&lt;p&gt;As it is written in the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharelinktask%28v=vs.92%29.aspx"&gt;MSDN&lt;/a&gt; documentation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;img title="Public property" alt="Public property" src="http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif" /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharelinktask.linkuri%28v=vs.92%29.aspx"&gt;LinkUri&lt;/a&gt;: Gets or sets the link URI that will be displayed in the link sharing dialog. &lt;/li&gt;

  &lt;li&gt;&lt;img title="Public property" alt="Public property" src="http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif" /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharelinktask.message%28v=vs.92%29.aspx"&gt;Message&lt;/a&gt;: Gets or sets the message that will accompany the link when it is shared. &lt;/li&gt;

  &lt;li&gt;&lt;img title="Public property" alt="Public property" src="http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif" /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharelinktask.title%28v=vs.92%29.aspx"&gt;Title&lt;/a&gt;: Gets or sets the title of the link to be shared. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NOTE: You will also have to include the following namespace &lt;em&gt;using Microsoft.Phone.Tasks;&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Example:&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lets create a new Windows Phone application project, create a new Image folder with appbar folder inside and add there two images: one for icon for Facebook, another for Twitter and one more that I will use for sending mail. (If you do not know from where to get metro free icons check the WindowsPhoneGeek`s &lt;a href="http://windowsphonegeek.com/Resources/UX#ux"&gt;Dev Gude UX section&lt;/a&gt; I fund there some really cool stuff) .&lt;/p&gt;

&lt;p&gt;NOTE: The build action of the images have to be set to Content(more about the different Build Actions &lt;a href="http://windowsphonegeek.com/tips/wp7-working-with-images-content-vs-resource-build-action"&gt;here&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_4_1_2_3_4_5_6_7_8_9_10_11_12.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="195" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_1_2_3_4_5_6_7_8_9_10_11_12_13_14.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next add the following buttons into the application bar:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;phone:PhoneApplicationPage.ApplicationBar&amp;gt;
    &amp;lt;shell:ApplicationBar IsVisible=&amp;quot;True&amp;quot; IsMenuEnabled=&amp;quot;True&amp;quot;&amp;gt;
        &amp;lt;shell:ApplicationBarIconButton IconUri=&amp;quot;/Images/appbar/email.png&amp;quot; x:Name=&amp;quot;email&amp;quot; Click=&amp;quot;email_Click&amp;quot; Text=&amp;quot;Send Email&amp;quot;/&amp;gt;
        &amp;lt;shell:ApplicationBarIconButton IconUri=&amp;quot;/Images/appbar/fb.png&amp;quot; x:Name=&amp;quot;fb&amp;quot; Click=&amp;quot;fb_Click&amp;quot; Text=&amp;quot;Facebook&amp;quot;/&amp;gt;
        &amp;lt;shell:ApplicationBarIconButton IconUri=&amp;quot;/Images/appbar/twitter.png&amp;quot; x:Name=&amp;quot;twitter&amp;quot; Click=&amp;quot;twitter_Click&amp;quot; Text=&amp;quot;Twitter&amp;quot;/&amp;gt;
    &amp;lt;/shell:ApplicationBar&amp;gt;
&amp;lt;/phone:PhoneApplicationPage.ApplicationBar&amp;gt;&lt;/pre&gt;
&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_2_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="133" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20.png" width="244" border="0" /&gt;&lt;/a&gt; 

&lt;p&gt;And finally add the following code inside the ApplicationBar buttons click handlers:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;private void email_Click(object sender, EventArgs e)
{        
    EmailComposeTask task = new EmailComposeTask();
    task.Subject = this.PageTitle.Text;
    task.Body = &amp;quot;Sample mail message!&amp;quot;;
    task.Show();
}

private void fb_Click(object sender, EventArgs e)
{
    ShareLinkTask shareLinkTask = new ShareLinkTask();
    shareLinkTask.LinkUri = new Uri( &amp;quot;http://www.windowsphonegeek.com&amp;quot;, UriKind.Absolute);
    shareLinkTask.Message = &amp;quot;Sample Facebook message!&amp;quot;;
    shareLinkTask.Show();
}

private void twitter_Click(object sender, EventArgs e)
{
    ShareLinkTask shareLinkTask = new ShareLinkTask();
    shareLinkTask.LinkUri = new Uri(&amp;quot;http://www.windowsphonegeek.com&amp;quot;, UriKind.Absolute);
    shareLinkTask.Message = &amp;quot;Sample Twitter message!&amp;quot;;
    shareLinkTask.Show();
}&lt;/pre&gt;

&lt;p&gt;Alternatively you can use a single social network icon, and users will select from the dialog the type of the social network that they want to use.&lt;/p&gt;

&lt;p&gt;That's it, build and run. Note that you have to test on a real device! Grab the source form here:&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:8011c66e-daac-46e1-b3e3-cee10c40f221" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt; &lt;a href="http://www.windowsphonegeek.com/upload/tips/WindowsPhoneSharingSocialNetworks.zip" target="_blank"&gt;SocialNetworksWP7.zip&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <pubDate>2012-03-01T10:20:42.0000000+02:00</pubDate>
    </item>
    <item>
      <title>Windows Phone Data Binding between Elements using the Designer</title>
      <link>http://www.windowsphonegeek.com/tips/Windows-Phone-Data-Binding-between-Elements-using-the-Designer</link>
      <description>&lt;p&gt;by Waleed Arafa Al-Zoghby&lt;/p&gt;  &lt;p&gt;In this article I'm going to talk about &amp;quot;Data Binding&amp;quot; between elements. I will use &amp;quot;Slider&amp;quot; &amp;amp; &amp;quot;TextBox&amp;quot; elements to clarify the idea.&lt;/p&gt;  &lt;p&gt;Suppose that you have 2 elements a slider and a TextBox; and you want to bind the value of slider to the text property of textbox element so you will have a binding source: &amp;quot;Slider&amp;quot; and Binding target: &amp;quot;TextBox&amp;quot; .... it's easy....! Add an event handler &amp;quot;ValueChanged&amp;quot; of slider element and write one line of code like ' TextBox1.Text = Slider1.Value.ToString(); '... it's a traditional method to bind! But I want to demonstrate a feature supported by Silverlight for Windows Phone without adding an event handler.&lt;/p&gt;  &lt;p&gt;We will create a new Windows Phone application and drag &amp;amp; drop a slider and TextBox elements on the current page like on the screenshot below. Next, select the TextBox and then "&lt;em&gt;Apply Data Binding&lt;/em&gt;." from the Properties Window:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/61651864.png_2.jpg"&gt;&lt;img title="61651864.png" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="154" alt="61651864.png" src="http://www.windowsphonegeek.com/upload/tips/61651864.png_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_4_1_2_3_4_5_6_7_8_9_10_11.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="165" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_1_2_3_4_5_6_7_8_9_10_11_12_13.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Next, select &amp;quot;Slider&amp;quot; as a binding source from the popup window:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_6_1_2_3_4_5_6_7_8_9_10.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; border-right-width: 0px" height="184" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_2_1_2_3_4_5_6_7_8_9_10.png" width="298" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After that select the property of the binding source(in our case "Value") and the type of the binding:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/19730205.png_2.jpg"&gt;&lt;img title="19730205.png" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="154" alt="19730205.png" src="http://www.windowsphonegeek.com/upload/tips/19730205.png_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_8_1_2_3_4_5_6_7_8_9.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="134" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_3_1_2_3_4_5_6_7_8_9.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/93875382.png_2.jpg"&gt;&lt;img title="93875382.png" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="154" alt="93875382.png" src="http://www.windowsphonegeek.com/upload/tips/93875382.png_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_10_1_2_3_4_5.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="148" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_4_1_2_3_4_5.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you select &amp;quot;one-way&amp;quot; ... when you change the value of the slider, the textbox value will be changed. Otherwise, if you select &amp;quot;two-way&amp;quot; ... when you change the value of any element the other one will be affected as well.&lt;/p&gt;  &lt;p&gt;Note: take a look at the binding of the Text property of the textbox element&lt;/p&gt;  &lt;pre class="brush: xml;"&gt; &amp;lt;TextBox Height=&amp;quot;72&amp;quot; HorizontalAlignment=&amp;quot;Left&amp;quot; Margin=&amp;quot;146,463,0,0&amp;quot; Name=&amp;quot;textBox1&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Width=&amp;quot;156&amp;quot; TextAlignment=&amp;quot;Center&amp;quot; Text=&amp;quot;{Binding Path=Value, Mode=TwoWay, ElementName=slider1}&amp;quot; /&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/61325188.png_2.jpg"&gt;&lt;img title="61325188.png" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="61325188.png" src="http://www.windowsphonegeek.com/upload/tips/61325188.png_thumb.jpg" width="132" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Solution attached.&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:31284def-becf-492a-bc1f-82d514f9bc49" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt; &lt;a href="http://www.windowsphonegeek.com/upload/tips/DataBindingTest.rar" target="_blank"&gt;DataBindingTest.rar&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <pubDate>2012-02-17T12:01:03.0000000+02:00</pubDate>
    </item>
    <item>
      <title>Windows Phone App Development for Beginners #6 Layout</title>
      <link>http://www.windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-6-Layout</link>
      <description>&lt;p&gt;by WindowsPhoneGeek&lt;/p&gt;  &lt;p&gt;This is the 6th post&amp;#160; from the &amp;quot;&lt;em&gt;Windows Phone Application Development for Beginners&lt;/em&gt;&amp;quot; series of articles in which I use a more informal approach in order to explain everything you need to know in order to get started developing Windows Phone applications in a simple and easy to understand way. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-1-Intro"&gt;Windows Phone App Development for Beginners #1: Intro&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-2-Installing-the-Tools"&gt;Windows Phone App Development for Beginners #2 Installing the Tools&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-3-Getting-Help"&gt;Windows Phone App Development for Beginners #3 Getting Help&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-4-First-Visual-Studio-project"&gt;Windows Phone App Development for Beginners #4 First Visual Studio project&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-5-Basic-XAML"&gt;Windows Phone App Development for Beginners #5 Basic XAML&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Windows Phone App Development for Beginners #6 Layout&lt;/strong&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;&lt;em&gt;NOTE&lt;/em&gt;: If you are a professional Windows Phone Developer you should probably stop reading now - &lt;em&gt;this series is for absolute beginners.&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In short you use different &lt;acronym&gt;Panels to define the layout of your Windows Phone application. The term layout describes the process of sizing and positioning objects in your app. To position UI elements such as buttons,checkboxes, shapes, text, and other content presented on the screen, you must put them in a Panel (or other container object).&lt;/acronym&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: I will start using the terms "UI element" or "Object" in order to describe elements such as buttons,checkboxes, shapes, text, and other content presented on the screen.&lt;/p&gt;  &lt;p&gt;&lt;acronym&gt;To allow for complex layouts, Silverlight for Windows Phone currently implements panel elements such as Canvas, StackPanel, and Grid discussed below.&lt;/acronym&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_20_1.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="126" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_9_1.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_24_1_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="28" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_11_1_2.png" width="102" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_28_1_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="24" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_13_1_2.png" width="102" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_22_1.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; border-right-width: 0px" height="26" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_10_1.png" width="96" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;acronym&gt;&lt;strong&gt;&lt;font size="3"&gt;Canvas&lt;/font&gt;&lt;/strong&gt;&lt;/acronym&gt;&lt;/p&gt;  &lt;p&gt;Canvas defines an area within which you can explicitly position child objects by specifying x and y coordinates in pixels. The x and y coordinates are often specified by using the &lt;strong&gt;Canvas.Left&lt;/strong&gt; and &lt;strong&gt;Canvas.Top&lt;/strong&gt; that determine the position of the child(inside) element like for example:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;Canvas Width=&amp;quot;400&amp;quot; Height=&amp;quot;400&amp;quot; Background=&amp;quot;Green&amp;quot;&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text&amp;quot; Canvas.Left=&amp;quot;100&amp;quot; Canvas.Top=&amp;quot;100&amp;quot;/&amp;gt;
&amp;lt;/Canvas&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_2_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="228" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For reference take a look at the MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas%28VS.95%29.aspx"&gt;documentation&lt;/a&gt;.&lt;acronym&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/acronym&gt;&lt;/p&gt;

&lt;p&gt;&lt;acronym&gt;&lt;strong&gt;&lt;font size="3"&gt;StackPanel&lt;/font&gt;&lt;/strong&gt;&lt;/acronym&gt;&lt;/p&gt;

&lt;p&gt;StackPanel arranges child elements into a single line that can be oriented either horizontally or vertically. You can change its orientation via its &lt;strong&gt;Orientation&lt;/strong&gt; property. By default if you do not change anything the orientation is set to vertical:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;StackPanel Background=&amp;quot;Red&amp;quot;&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text1&amp;quot;/&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text2&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button1&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button2&amp;quot;/&amp;gt;
&amp;lt;/StackPanel&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_6_1_2_3_4_5_6_7_8_9.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="149" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_2_1_2_3_4_5_6_7_8_9.png" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_12_1_2_3_4_5.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_5_1_2_3_4_5.png" width="85" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: You can also use &amp;lt;StackPanel Background=&amp;quot;Red&amp;quot; &lt;strong&gt;Orientation=&amp;quot;Vertical&amp;quot;&lt;/strong&gt;&amp;gt; &amp;lt;/StackPanel &amp;gt;&lt;/p&gt;

&lt;p&gt;You can set the StackPanel to horizontal orientation using &lt;strong&gt;Orientation=&amp;quot;Horizontal&lt;/strong&gt;":&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;StackPanel Background=&amp;quot;Red&amp;quot; Orientation=&amp;quot;Horizontal&amp;quot;&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text1&amp;quot;/&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text2&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button1&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button2&amp;quot;/&amp;gt;
&amp;lt;/StackPanel&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_8_1_2_3_4_5_6_7_8.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="127" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_3_1_2_3_4_5_6_7_8.png" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_14_1_2_3_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="76" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_6_1_2_3_4_5.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For reference take a look at the MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.stackpanel%28VS.95%29.aspx"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;acronym&gt;&lt;strong&gt;&lt;font size="3"&gt;Grid&lt;/font&gt;&lt;/strong&gt;&lt;/acronym&gt;&lt;/p&gt;

&lt;p&gt;Grid defines a table layout consisting of columns and rows. By default, a Grid contains one row and one column. To define multiple rows and columns use the &lt;strong&gt;ColumnDefinitions&lt;/strong&gt; and &lt;strong&gt;RowDefinitions&lt;/strong&gt; collections. You can specify the size of the particular rows/columns via &lt;strong&gt;RowDefinition&lt;/strong&gt; and &lt;strong&gt;ColumnDefinition&lt;/strong&gt; objects. You can position objects in specific cells of the Grid by using the &lt;strong&gt;Grid.Column&lt;/strong&gt; and Grid.Row attached properties. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;NOTE: &lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;"*" sizing distributes remaining available space proportionally. &lt;/li&gt;

  &lt;li&gt;"&lt;em&gt;Auto&lt;/em&gt;" sizing distributes space evenly based on the size of the content that is within a column or row. &lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;Grid.RowDefinitions&amp;gt;
        &amp;lt;RowDefinition Height=&amp;quot;100&amp;quot;/&amp;gt;
        &amp;lt;RowDefinition Height=&amp;quot;Auto&amp;quot;/&amp;gt;
        &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot;/&amp;gt;
    &amp;lt;/Grid.RowDefinitions&amp;gt;
    &amp;lt;Grid.ColumnDefinitions&amp;gt;
        &amp;lt;ColumnDefinition Width=&amp;quot;100&amp;quot;/&amp;gt;
        &amp;lt;ColumnDefinition Width=&amp;quot;Auto&amp;quot;/&amp;gt;
        &amp;lt;ColumnDefinition Width=&amp;quot;*&amp;quot;/&amp;gt;
    &amp;lt;/Grid.ColumnDefinitions&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text1&amp;quot; Grid.Row=&amp;quot;0&amp;quot; Grid.Column=&amp;quot;0&amp;quot;/&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text2&amp;quot; Grid.Row=&amp;quot;0&amp;quot; Grid.Column=&amp;quot;1&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button1&amp;quot; Grid.Row=&amp;quot;0&amp;quot; Grid.Column=&amp;quot;2&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button2&amp;quot; Grid.Row=&amp;quot;1&amp;quot; Grid.Column=&amp;quot;0&amp;quot;/&amp;gt;
    &amp;lt;TextBlock Text=&amp;quot;Text3&amp;quot; Grid.Row=&amp;quot;1&amp;quot; Grid.Column=&amp;quot;2&amp;quot;/&amp;gt;
    &amp;lt;Button Content=&amp;quot;Button3&amp;quot; Grid.Row=&amp;quot;2&amp;quot; Grid.Column=&amp;quot;1&amp;quot;/&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_16_1_2_3.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_7_1_2_3.png" width="200" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_18_1_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_8_1_2.png" width="190" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also use the Visual Studio Toolbox to define your Grid layout as described in the &lt;a href="http://windowsphonegeek.com/tips/Windows-Phone-App-Development-for-Beginners-5-Basic-XAML"&gt;previous post&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_25.png"&gt;&lt;img title="image" style="border-right: 0px; padding-right: 0px; border-top: 0px; display: inline; padding-left: 0px; background-image: none; margin: 10px 0px; border-left: 0px; padding-top: 0px; border-bottom: 0px" height="404" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_1_2_3_4_5_6_7_8_9_10_11_12.png" width="593" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For reference take a look at the MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid%28VS.95%29.aspx"&gt;documentation.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it for now.&amp;#160; &lt;/p&gt;

&lt;p&gt;I hope the post was helpful.&lt;/p&gt;


&lt;font face="Arial" color="#606060"&gt;&lt;/font&gt;</description>
      <pubDate>2012-02-09T10:53:24.0000000+02:00</pubDate>
    </item>
    <item>
      <title>How to add Tilt Effect to the Windows Phone MultiselectList control</title>
      <link>http://www.windowsphonegeek.com/tips/How-to-add-Tilt-Effect-to-the-Windows-Phone-MultiselectList-control</link>
      <description>&lt;p&gt;by WindowsPhoneGeek&lt;/p&gt;  &lt;p&gt;In this quick tip I am going to talk about how to add TiltEffect to the MultilistSelect control(which is part from the &lt;a href="http://windowsphonegeek.com/WPToolkitBook2nd"&gt;Windows Phone Toolkit&lt;/a&gt;). &lt;/p&gt;  &lt;p&gt;For more information of how to get started using MultiselectList control take a look at:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://windowsphonegeek.com/articles/Windows-Phone-Toolkit-MultiselectList-in-depth--Part1-key-concepts-and-API"&gt;Windows Phone Toolkit MultiselectList in depth | Part1: key concepts and API&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://windowsphonegeek.com/articles/Windows-Phone-Toolkit-MultiselectList-in-depth-Part2-Data-Binding"&gt;Windows Phone Toolkit MultiselectList in depth| Part2: Data Binding&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I will also use the source code from this previously posted article: &lt;a href="http://windowsphonegeek.com/articles/How-to-get-the-Tapped-Item-in-a-MultiselectList-control"&gt;How to get the Tapped Item in a MultiselectList control&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;How to add Tilt Effect to MultiselectList?&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Usually, the only thing that you have to do in order to use the TiltEffect&amp;#160; is to set &lt;em&gt;toolkit:TiltEffect.IsTiltEnabled=&amp;quot;True&amp;quot;&lt;/em&gt;&amp;#160; like in the snippet bellow:&lt;/p&gt;    &lt;pre class="brush: xml;"&gt;&amp;lt;toolkit:MultiselectList x:Name=&amp;quot;multiselectList&amp;quot; toolkit:TiltEffect.IsTiltEnabled=&amp;quot;True&amp;quot;&amp;gt;
    &amp;lt;toolkit:MultiselectList.ItemTemplate&amp;gt;
        &amp;lt;DataTemplate&amp;gt;
            &amp;lt;StackPanel Orientation=&amp;quot;Vertical&amp;quot; Margin=&amp;quot;0,5,0,5&amp;quot;&amp;gt;
                &amp;lt;TextBlock Text=&amp;quot;{Binding Title}&amp;quot; Style=&amp;quot;{StaticResource PhoneTextTitle3Style}&amp;quot; /&amp;gt;
                &amp;lt;TextBlock Text=&amp;quot;{Binding SubTitle}&amp;quot; Style=&amp;quot;{StaticResource PhoneTextSmallStyle}&amp;quot;/&amp;gt;
            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/DataTemplate&amp;gt;
    &amp;lt;/toolkit:MultiselectList.ItemTemplate&amp;gt;
&amp;lt;/toolkit:MultiselectList&amp;gt;&lt;/pre&gt;

&lt;p&gt;Where "toolkit" is the following namespace:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;phone:PhoneApplicationPage 
..
xmlns:toolkit=&amp;quot;clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit&amp;quot;&amp;gt;&lt;/pre&gt;

&lt;p&gt;However, for the MultiselectList this is not enough, since the MultiselectItem is not in the TiltableItems list by default. This can be fixed quickly as shown in the snippet bellow:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public MainPage()
{
    InitializeComponent();

    // enable tilt effect for multiselect items
    TiltEffect.TiltableItems.Add(typeof(MultiselectItem));

   ///...
}&lt;/pre&gt;

&lt;p&gt;NOTE: You will also have to include the following namespace:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;using Microsoft.Phone.Controls;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is the source code:&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:1b1afc89-b814-43d8-a6ff-69a18e38e63e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt; &lt;a href="http://www.windowsphonegeek.com/upload/tips/MultiselectListItemTap.zip" target="_blank"&gt;MultiselectListTiltEffect&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;Hope the tip was helpful.&lt;/p&gt;</description>
      <pubDate>2012-01-27T15:00:14.0000000+02:00</pubDate>
    </item>
    <item>
      <title>PROTECT YOUR Windows Phone APP AGAINST (casual) PIRACY</title>
      <link>http://www.windowsphonegeek.com/tips/PROTECT-YOUR-Windows-Phone-APP-AGAINST--casual--PIRACY</link>
      <description>&lt;p&gt;by &lt;a href="http://www.windowsphonegeek.com/UserProfile/View?userName=Venetasoft"&gt;Lorenzin David&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you already know, a pirated xap of your app was probably uploaded to p2p networks after 1 day from publication,&amp;nbsp; and is now illegally used by lots of people.&lt;/p&gt;
&lt;p&gt;In the meantime MS will introduce the server-side-encryption (hopefully soon), hacking a xap is so simple that it is done by automated web applications.&lt;/p&gt;
&lt;p&gt;Anyway, you can now turn piracy to your advantage! With this code, you can detect if your app was hacked using the "automated" method, and if so just open the Marketplace pointing to your "real" app.&lt;/p&gt;
&lt;p&gt;Basically, an hacked xap is identical as your original xap, lacking a file called WMAppPRHeader.xml (the DRM file), so the phone considers it as a homebrew one and runs it as "full" on unlocked devices.&lt;/p&gt;
&lt;p&gt;Just add this code when your app starts and you will be safe for 99.99% of times (this will not protect against reverse engineering and dedicated app attack, but if this happens your app will be famous !). It is a good idea to obfuscate the code &lt;span style="text-decoration: underline;"&gt;too&lt;/span&gt;, but first of all implements this trick!&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;using System.Xml.Linq;
using Microsoft.Phone.Controls;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Phone.Marketplace;
using Microsoft.Phone.Tasks;
using System.Collections.ObjectModel;
using Coding4Fun.Phone.Controls.Data;
 
public static bool IsHacked()
{
    try
    {
        if (Debugger.IsAttached == true) //then WMAppPRHeader.xml file will be added during AppHub certification only! So this has to be skipped during development.
            return false;

        //scramble WMAppPRHeader.xml file name to make life a little harder in case of reverse engineering
        string fl = "xxx" + "W" + "xxxx" + "M" + "xxxx" + "A" + "xxxx" + "p" + "xxxpxxx" + "PxR" + "xxxxx" + "Hxxxxxxx" + "exxxxxxa" + "xxxx" + "d" + "xxxx" + "xxxxe" + "rxx" + "xxx";
        fl = fl.Replace("x", string.Empty) + "." + "x" + "m" + "l";
        XDocument doc = XDocument.Load(fl); //is hacked, this file is missing or empty!!!
        return false;
    }
    catch (Exception)
    {
        MessageBox.Show("This app was pirated and is not safe to use, please download the original one from Marketplace.");
        MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();

        //ProcutdID will be changed after APpHub certification, so has to be read from manifest!

        marketplaceDetailTask.ContentIdentifier = PhoneHelper.GetAppAttribute("ProductID").Replace("{", string.Empty).Replace("}", string.Empty).Trim(); //download Coding4Fun toolkit for this helper
        marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
        marketplaceDetailTask.Show();
 
        return true;
     }
}&lt;/pre&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description>
      <pubDate>2012-01-23T13:48:36.0000000+02:00</pubDate>
    </item>
    <item>
      <title>How to add Panorama to existing WP7 project</title>
      <link>http://www.windowsphonegeek.com/tips/How-to-add-Panorama-to-existing-WP7-project</link>
      <description>&lt;p&gt;by Tianyu Zhang&lt;/p&gt;  &lt;p&gt;While developing my latest WP7 app I came across the question how to add a Panorama to my existing WP7 project. I did not want to use the default Visual Studio templates because they generate too much code(for a simple app like mine) with all the data binding and view models.&lt;/p&gt;  &lt;p&gt;In short I had a database and wanted to show some data in a Panorama control without using MVVM or any default VisualStudio template. So here is what I did:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step1.&lt;/strong&gt; Lets say that we have an existing Windows Phone application project.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step2.&lt;/strong&gt; Add a reference to "&lt;em&gt;&lt;font color="#ff0000"&gt;Microsoft.Phone.Controls&lt;/font&gt;&lt;/em&gt;" available under the .NET tab in the "Add Reference" window:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_2_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="136" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_4_1_2_3_4_5_6_7_8_9_10.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="274" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_1_1_2_3_4_5_6_7_8_9_10_11.png" width="354" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_6_1_2_3_4_5_6_7_8.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; border-right-width: 0px" height="173" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_2_1_2_3_4_5_6_7_8.png" width="174" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step3.&lt;/strong&gt; Include the following namespace into your page:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;xmlns:controls=&amp;quot;clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls&amp;quot;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_8_1_2_3_4_5_6_7.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 10px 0px; padding-top: 0px; border-right-width: 0px" height="189" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_3_1_2_3_4_5_6_7.png" width="504" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step4&lt;/strong&gt;. That's it now you can add Panorama and PanoramaItem via the "&lt;em&gt;control&lt;/em&gt;" namespace that you have defined in Step3 :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.windowsphonegeek.com/upload/tips/image_10_1_2_3_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; padding-right: 0px; display: inline; padding-left: 0px; border-left-width: 0px; background-image: none; border-bottom-width: 0px; margin: 0px; padding-top: 0px; border-right-width: 0px" height="103" alt="image" src="http://www.windowsphonegeek.com/upload/tips/image_thumb_4_1_2_3_4.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;Grid x:Name=&amp;quot;ContentPanel&amp;quot; Grid.Row=&amp;quot;1&amp;quot; Margin=&amp;quot;12,0,12,0&amp;quot;&amp;gt;
    &amp;lt;controls:Panorama Title=&amp;quot;Panorama&amp;quot;&amp;gt;
        &amp;lt;controls:PanoramaItem&amp;gt;First Item&amp;lt;/controls:PanoramaItem&amp;gt;
        &amp;lt;controls:PanoramaItem&amp;gt;Second Item&amp;lt;/controls:PanoramaItem&amp;gt;
    &amp;lt;/controls:Panorama&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;Grab the source here:&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:73b5bc94-2a18-49f2-9906-9aed96d07e7e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt; &lt;a href="http://www.windowsphonegeek.com/upload/tips/PanoramaSample.zip" target="_blank"&gt;PanoramaSample&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <pubDate>2012-01-16T23:43:59.0000000+02:00</pubDate>
    </item>
  </channel>
</rss>
