<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>tombstonehelper Wiki Rss Feed</title><link>http://tombstonehelper.codeplex.com/</link><description>tombstonehelper Wiki Rss Description</description><item><title>New Comment on "Documentation"</title><link>http://tombstonehelper.codeplex.com/documentation?&amp;ANCHOR#C24085</link><description>You can make life more easy for adding custom controls.&amp;#10;It&amp;#39;s not enough to&amp;#58;&amp;#10;&amp;#34;Add appropriate entries to AllTombstoneRestorers&amp;#40;&amp;#41; and AllSupportedTombstoners&amp;#40;&amp;#41; in &amp;#34;PhoneApplicationPageExtensions.cs&amp;#34;.&amp;#34;&amp;#10;&amp;#10;Because in the AllSupportedTombstoners method the first thing is a foreach loop that checks if the control type exists in the property&amp;#58; &amp;#34;SupportedTypes&amp;#34;.&amp;#10;Because we didn&amp;#39;t add the new custom type to that list we will get an exception. Even if we did add the 2 enteries like written above&amp;#58;&amp;#10;&amp;#10;            &amp;#47;&amp;#47; There will be errors if the unsupported types have been passed in the filter.&amp;#10;            &amp;#47;&amp;#47; Highlight this by raising an error&amp;#10;            foreach &amp;#40;var type in filteredTypesToSave&amp;#41;&amp;#10;            &amp;#123;&amp;#10;                if &amp;#40;&amp;#33;SupportedTypes.Contains&amp;#40;type&amp;#41;&amp;#10;                 &amp;#38;&amp;#38; &amp;#33;TombstoneHelperExtensibility.CustomTombstoners.ContainsKey&amp;#40;type&amp;#41;&amp;#41;&amp;#10;                &amp;#123;&amp;#10;                    throw new ArgumentException&amp;#40;string.Format&amp;#40;&amp;#34;TombstoneHelper doesn&amp;#39;t know how to handle the type&amp;#58; &amp;#123;0&amp;#125;&amp;#123;1&amp;#125;You could create and register a custom tombstoner for this type or remove it from the list of types to use.&amp;#34;, type.ToString&amp;#40;&amp;#41;, System.Environment.NewLine&amp;#41;&amp;#41;&amp;#59;&amp;#10;                &amp;#125;&amp;#10;            &amp;#125;&amp;#10;&amp;#10;You can fix it in 2 ways&amp;#58;&amp;#10;&amp;#40;1&amp;#41; Add the 2 enteries like you said AND add the new type to the SupportedTypes list property hardcoded.&amp;#10;&amp;#10;OR&amp;#10;&amp;#10;&amp;#40;2&amp;#41; At the begining of the method &amp;#34;AllSupportedTombstoners&amp;#34; &amp;#40;Before the type checker foreach&amp;#41; call a new static method, AND&amp;#10;also add the call for this method to begining of the &amp;#34;AllTombstoneRestorers&amp;#34; method.&amp;#10;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&amp;#10;        &amp;#47;&amp;#47;&amp;#47; TODO&amp;#58; Register here all the custom tombstoners&amp;#10;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&amp;#10;        private static void RegisterAllCustomTombstoners&amp;#40;&amp;#41;&amp;#10;        &amp;#123;&amp;#10;            TombstoneHelperExtensibility.RegisterCustomTombstoner&amp;#40;typeof&amp;#40;TextBlock&amp;#41;, new TextBlockTombstoner&amp;#40;&amp;#41;&amp;#41;&amp;#59;&amp;#10;        &amp;#125;&amp;#10;&amp;#10;this method uses the RegisterCustomTombstoner method inside the class &amp;#34;TombstoneHelperExtensibility&amp;#34;.&amp;#10;I prefer the second option because you don&amp;#39;t have to add the above written 2 enteries hardcoded for every new custome support for a new control.&amp;#10;&amp;#10;Just add a single line to this new method &amp;#58;-&amp;#41;&amp;#10;And besides, this way the CustomTombstoners actually means something.</description><author>orkazaz</author><pubDate>Fri, 15 Jun 2012 14:17:00 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20120615021700P</guid></item><item><title>New Comment on "Documentation"</title><link>http://tombstonehelper.codeplex.com/documentation?&amp;ANCHOR#C24084</link><description>You can make life more easy for adding custom controls.&amp;#10;It&amp;#39;s not enough to&amp;#58;&amp;#10;&amp;#34;Add appropriate entries to AllTombstoneRestorers&amp;#40;&amp;#41; and AllSupportedTombstoners&amp;#40;&amp;#41; in &amp;#34;PhoneApplicationPageExtensions.cs&amp;#34;.&amp;#34;&amp;#10;&amp;#10;Because in the AllSupportedTombstoners method the first thing is a foreach loop that checks if the control type exists in the property&amp;#58; &amp;#34;SupportedTypes&amp;#34;.&amp;#10;Because we didn&amp;#39;t add the new custom type to that list we will get an exception. Even if we did add the 2 enteries like written above&amp;#58;&amp;#10;&amp;#10;            &amp;#47;&amp;#47; There will be errors if the unsupported types have been passed in the filter.&amp;#10;            &amp;#47;&amp;#47; Highlight this by raising an error&amp;#10;            foreach &amp;#40;var type in filteredTypesToSave&amp;#41;&amp;#10;            &amp;#123;&amp;#10;                if &amp;#40;&amp;#33;SupportedTypes.Contains&amp;#40;type&amp;#41;&amp;#10;                 &amp;#38;&amp;#38; &amp;#33;TombstoneHelperExtensibility.CustomTombstoners.ContainsKey&amp;#40;type&amp;#41;&amp;#41;&amp;#10;                &amp;#123;&amp;#10;                    throw new ArgumentException&amp;#40;string.Format&amp;#40;&amp;#34;TombstoneHelper doesn&amp;#39;t know how to handle the type&amp;#58; &amp;#123;0&amp;#125;&amp;#123;1&amp;#125;You could create and register a custom tombstoner for this type or remove it from the list of types to use.&amp;#34;, type.ToString&amp;#40;&amp;#41;, System.Environment.NewLine&amp;#41;&amp;#41;&amp;#59;&amp;#10;                &amp;#125;&amp;#10;            &amp;#125;&amp;#10;&amp;#10;You can fix it in 2 ways&amp;#58;&amp;#10;&amp;#40;1&amp;#41; Add the 2 enteries like you said AND add the new type to the SupportedTypes list property hardcoded.&amp;#10;&amp;#10;OR&amp;#10;&amp;#10;&amp;#40;2&amp;#41; At the begining of the method &amp;#34;AllSupportedTombstoners&amp;#34; &amp;#40;Before the type checker foreach&amp;#41; call a new static method&amp;#58;&amp;#10;&amp;#10;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&amp;#10;        &amp;#47;&amp;#47;&amp;#47; TODO&amp;#58; Register here all the custom tombstoners&amp;#10;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&amp;#10;        private static void RegisterAllCustomTombstoners&amp;#40;&amp;#41;&amp;#10;        &amp;#123;&amp;#10;            TombstoneHelperExtensibility.RegisterCustomTombstoner&amp;#40;typeof&amp;#40;TextBlock&amp;#41;, new TextBlockTombstoner&amp;#40;&amp;#41;&amp;#41;&amp;#59;&amp;#10;        &amp;#125;&amp;#10;&amp;#10;this method uses the RegisterCustomTombstoner method inside the class &amp;#34;TombstoneHelperExtensibility&amp;#34;.&amp;#10;I prefer the second option because you don&amp;#39;t have to add the above written 2 enteries hardcoded.&amp;#10;Just add a single line to this new method.&amp;#10;And besides, this way the CustomTombstoners actually means something.</description><author>orkazaz</author><pubDate>Fri, 15 Jun 2012 11:47:44 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20120615114744A</guid></item><item><title>Updated Wiki: Home</title><link>http://tombstonehelper.codeplex.com/wikipage?version=14</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Tombstoning support just got REALLY simple!&lt;/h1&gt;
This library adds extension methods to PhoneApplicationPage so you don&amp;#39;t have to worry about maintaining the state of a page in your app if it gets tombstoned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;It just takes 2 lines of code!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(NavigatingCancelEventArgs e)
{
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e);  &lt;span style="color:Green;"&gt;// &amp;lt;- first line&lt;/span&gt;
}

&lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(NavigationEventArgs e)
{
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();  &lt;span style="color:Green;"&gt;// &amp;lt;- second line&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;If you add the above to your code then the &lt;i&gt;contents, checked state and scroll positions&lt;/i&gt; of &lt;b&gt;TextBoxes&lt;/b&gt;, &lt;b&gt;PasswordBoxes&lt;/b&gt;, &lt;b&gt;CheckBoxes&lt;/b&gt;, &lt;b&gt;RadioButtons&lt;/b&gt;, &lt;b&gt;Sliders&lt;/b&gt;, &lt;b&gt;ListBoxes&lt;/b&gt; and &lt;b&gt;ScrollViewers&lt;/b&gt; will be preserved.&lt;br /&gt;&lt;br /&gt;If you want to add support for other types this can be done as the code was designed to be &lt;i&gt;&lt;b&gt;easily extensible&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The code is &lt;i&gt;&lt;b&gt;optimised for performance&lt;/b&gt;&lt;/i&gt; but if you don&amp;#39;t use all of those types on your page you can get even better performance by just specifying the types of the objects you wish to save the state of:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
or 
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
or 
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState&amp;lt;TextBox, PasswordBox, CheckBox&amp;gt;();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;Yes. It&amp;#39;s reallly that simple.&lt;/b&gt;&lt;/h2&gt;You just need to make sure you&amp;#39;re given a name to the object you wish to save the state of.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;thisHasANameAndSoWillBeSaved&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Please note that there are much better ways of using it. See the &lt;a href="http://tombstonehelper.codeplex.com/documentation?referringTitle=Home"&gt;Documentation&lt;/a&gt; page for more details.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;All feedback, comments, questions, etc. greatly appreciated.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Tue, 13 Mar 2012 15:05:17 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120313030517P</guid></item><item><title>Updated Wiki: Home</title><link>http://tombstonehelper.codeplex.com/wikipage?version=13</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Tombstoning support just got REALLY simple!&lt;/h1&gt;
This library adds extension methods to PhoneApplicationPage so you don&amp;#39;t have to worry about maintaining the state of a page in your app if it gets tombstoned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;It just takes 2 lines of code!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(NavigatingCancelEventArgs e)
{
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e);  &lt;span style="color:Green;"&gt;// &amp;lt;- first line&lt;/span&gt;
}

&lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(NavigationEventArgs e)
{
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();  &lt;span style="color:Green;"&gt;// &amp;lt;- second line&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;If you add the above to your code then the &lt;i&gt;contents, checked state and scroll positions&lt;/i&gt; of &lt;b&gt;TextBoxes&lt;/b&gt;, &lt;b&gt;PasswordBoxes&lt;/b&gt;, &lt;b&gt;CheckBoxes&lt;/b&gt;, &lt;b&gt;RadioButtons&lt;/b&gt;, &lt;b&gt;Sliders&lt;/b&gt;, &lt;b&gt;ListBoxes&lt;/b&gt; and &lt;b&gt;ScrollViewers&lt;/b&gt; will be preserved.&lt;br /&gt;&lt;br /&gt;If you want to add support for other types this can be done as the code was designed to be &lt;i&gt;&lt;b&gt;easily extensible&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The code is &lt;i&gt;&lt;b&gt;optimised for performance&lt;/b&gt;&lt;/i&gt; but if you don&amp;#39;t use all of those types on your page you can get even better performance by just specifying the types of the objects you wish to save the state of:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
or 
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;Yes. It&amp;#39;s reallly that simple.&lt;/b&gt;&lt;/h2&gt;You just need to make sure you&amp;#39;re given a name to the object you wish to save the state of.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;thisHasANameAndSoWillBeSaved&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Please note that there are much better ways of using it. See the &lt;a href="http://tombstonehelper.codeplex.com/documentation?referringTitle=Home"&gt;Documentation&lt;/a&gt; page for more details.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;All feedback, comments, questions, etc. greatly appreciated.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Fri, 13 Jan 2012 11:28:58 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120113112858A</guid></item><item><title>New Comment on "Documentation"</title><link>http://tombstonehelper.codeplex.com/documentation?&amp;ANCHOR#C21118</link><description>&amp;#64;Pluginbaby - good spot. The base calls are acutally unnecessary as they don&amp;#39;t actually do anything. Just a result of my Resharper generated code. The wrong method being called was a result of me not updating everything correctly. &amp;#58;&amp;#40;</description><author>mrlacey</author><pubDate>Fri, 30 Sep 2011 17:36:01 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20110930053601P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tombstonehelper.codeplex.com/documentation?version=10</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Contents&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Adding support for other types&lt;/li&gt;
&lt;li&gt;Gotchas&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Download the library&lt;/li&gt;
&lt;li&gt;Add a reference to it in your project&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;Or use NuGet: &lt;a href="http://www.nuget.org/List/Packages/WP7TombstoneHelper" class="externalLink"&gt;http://www.nuget.org/List/Packages/WP7TombstoneHelper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;
&lt;h2&gt;Simple usage&lt;/h2&gt;
Include a reference to the namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; TombstoneHelper;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;In any pages that have something you may want to preserve during tombstoning, simply call &lt;b&gt;SaveState(e)&lt;/b&gt; in the &lt;b&gt;OnNavigatingFrom&lt;/b&gt; handler and &lt;b&gt;RestoreState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedTo&lt;/b&gt; handler.&lt;br /&gt;&lt;i&gt;&lt;b&gt;Note&lt;/b&gt; that I&amp;#39;m using OnNavingat&lt;b&gt;ing&lt;/b&gt;From method, rather than OnNavigat&lt;b&gt;ed&lt;/b&gt;From, as it allows us to detect the direction of navigation. This means we don&amp;#39;t save state if we know we won&amp;#39;t need it again. This can help improve the performance of the app.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e); 
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Ensure that every object you want to be preserved has a &lt;b&gt;Name&lt;/b&gt; specified.&lt;br /&gt;The code below is from &amp;quot;TextBoxes.xaml&amp;quot; in the demo project included with the source. It shows three textboxes, the middle of which won&amp;#39;t have it&amp;#39;s text automatically preserved during tombstoning.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;second (doesn&amp;#39;t have name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;That&amp;#39;s it!&lt;br /&gt;
&lt;h2&gt;Slightly more advanced usage&lt;/h2&gt;
If you want to improve performance you can specify only the types of the controls which you want to be preserved when calling &lt;b&gt;SaveState()&lt;/b&gt;.&lt;br /&gt;eg:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;or&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
&lt;/pre&gt;&lt;/div&gt;or in a more generic style&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState&amp;lt;ScrollViewer&amp;gt;();
&lt;/pre&gt;&lt;/div&gt;or&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState&amp;lt;ListBox, TextBox&amp;gt;();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Not only does this improve performance but it makes it easy to integrate this functionality to save some properties (typically the scroll position of a ListBox or ScrolViewer) where there is already a view model which preserves the data state.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Adding support for other types&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Add a new class to the project which implements &lt;b&gt;ICanTombstone&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Add the necessary code to implement the functionality. N.B. The key used for saving the state of the object should be a string comprising the name of the type and the name of the object separated by a &amp;#39;^&amp;#39; character.&lt;/li&gt;
&lt;li&gt;Add appropriate entries to &lt;i&gt;AllTombstoneRestorers()&lt;/i&gt; and &lt;i&gt;AllSupportedTombstoners()&lt;/i&gt; in &amp;quot;PhoneApplicationPageExtensions.cs&amp;quot;.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;If you are adding support for additional types then reviewing the exising implementations of &lt;b&gt;ICanTombstone&lt;/b&gt; is highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Gotchas&lt;/h1&gt;
You &lt;i&gt;may&lt;/i&gt; experience strange behaviour or unwanted side effects in the following situations&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have an event that is triggered upon setting the property that automatically preserved. e.g. If it&amp;#39;s a TextBox and you&amp;#39;re handling the &lt;i&gt;TextChanged&lt;/i&gt; event—it may have too account for it being triggered additional times.&lt;/li&gt;
&lt;li&gt;If you are databinding the property which is has events or actions in response to setting it.&lt;/li&gt;
&lt;li&gt;If you are generating the UI in code at runtime. &lt;/li&gt;
&lt;li&gt;If you are also doing something with the State object yourself then do it &lt;b&gt;after&lt;/b&gt; calling SaveState() as it will clear the contents of the state object to ensure it doen&amp;#39;t have anything more than it needs in it.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If one of these scenarios does cause a problem then get in touch as there may be a workaround.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Fri, 30 Sep 2011 17:34:21 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110930053421P</guid></item><item><title>New Comment on "Documentation"</title><link>http://tombstonehelper.codeplex.com/documentation?&amp;ANCHOR#C21107</link><description>Awesome project&amp;#33;&amp;#10;There is a mistake in the sample of this page&amp;#58;&amp;#10;&amp;#10;Replace&amp;#58;&amp;#10;&amp;#10;    protected override void OnNavigatingFrom&amp;#40;System.Windows.Navigation.NavigatingCancelEventArgs e&amp;#41;&amp;#10;    &amp;#123;&amp;#10;        this.SaveState&amp;#40;e&amp;#41;&amp;#59; &amp;#10;&amp;#10;        base.OnNavigatedFrom&amp;#40;&amp;#41;&amp;#59;&amp;#10;    &amp;#125;&amp;#10;&amp;#10;With&amp;#58;&amp;#10;&amp;#10;    protected override void OnNavigatingFrom&amp;#40;System.Windows.Navigation.NavigatingCancelEventArgs e&amp;#41;&amp;#10;    &amp;#123;&amp;#10;        this.SaveState&amp;#40;e&amp;#41;&amp;#59; &amp;#10;&amp;#10;        base.OnNavigatingFrom&amp;#40;&amp;#41;&amp;#59;&amp;#10;    &amp;#125;</description><author>Pluginbaby</author><pubDate>Fri, 30 Sep 2011 02:47:30 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20110930024730A</guid></item><item><title>Updated Wiki: Home</title><link>http://tombstonehelper.codeplex.com/wikipage?version=12</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Tombstoning support just got REALLY simple!&lt;/h1&gt;
This library adds extension methods to PhoneApplicationPage so you don&amp;#39;t have to worry about maintaining the state of a page in your app if it gets tombstoned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;It just takes 2 lines of code!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e);  &lt;span style="color:Green;"&gt;// &amp;lt;- first line&lt;/span&gt;
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();  &lt;span style="color:Green;"&gt;// &amp;lt;- second line&lt;/span&gt;
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;If you add the above to your code then the &lt;i&gt;contents, checked state and scroll positions&lt;/i&gt; of &lt;b&gt;TextBoxes&lt;/b&gt;, &lt;b&gt;PasswordBoxes&lt;/b&gt;, &lt;b&gt;CheckBoxes&lt;/b&gt;, &lt;b&gt;RadioButtons&lt;/b&gt;, &lt;b&gt;Sliders&lt;/b&gt;, &lt;b&gt;ListBoxes&lt;/b&gt; and &lt;b&gt;ScrollViewers&lt;/b&gt; will be preserved.&lt;br /&gt;&lt;br /&gt;If you want to add support for other types this can be done as the code was designed to be &lt;i&gt;&lt;b&gt;easily extensible&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The code is &lt;i&gt;&lt;b&gt;optimised for performance&lt;/b&gt;&lt;/i&gt; but if you don&amp;#39;t use all of those types on your page you can get even better performance by just specifying the types of the objects you wish to save the state of:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
or 
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;Yes. It&amp;#39;s reallly that simple.&lt;/b&gt;&lt;/h2&gt;You just need to make sure you&amp;#39;re given a name to the object you wish to save the state of.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;thisHasANameAndSoWillBeSaved&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Please note that there are much better ways of using it. See the &lt;a href="http://tombstonehelper.codeplex.com/documentation?referringTitle=Home"&gt;Documentation&lt;/a&gt; page for more details.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;All feedback, comments, questions, etc. greatly appreciated.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Mon, 19 Sep 2011 20:03:56 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20110919080356P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tombstonehelper.codeplex.com/documentation?version=9</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Contents&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Adding support for other types&lt;/li&gt;
&lt;li&gt;Gotchas&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Download the library&lt;/li&gt;
&lt;li&gt;Add a reference to it in your project&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;Or use NuGet: &lt;a href="http://www.nuget.org/List/Packages/WP7TombstoneHelper" class="externalLink"&gt;http://www.nuget.org/List/Packages/WP7TombstoneHelper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;
&lt;h2&gt;Simple usage&lt;/h2&gt;
Include a reference to the namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; TombstoneHelper;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;In any pages that have something you may want to preserve during tombstoning, simply call &lt;b&gt;SaveState(e)&lt;/b&gt; in the &lt;b&gt;OnNavigatingFrom&lt;/b&gt; handler and &lt;b&gt;RestoreState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedTo&lt;/b&gt; handler.&lt;br /&gt;&lt;i&gt;&lt;b&gt;Note&lt;/b&gt; that I&amp;#39;m using OnNavingat&lt;b&gt;ing&lt;/b&gt;From method, rather than OnNavigat&lt;b&gt;ed&lt;/b&gt;From, as it allows us to detect the direction of navigation. This means we don&amp;#39;t save state if we know we won&amp;#39;t need it again. This can help improve the performance of the app.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e); 

        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedFrom();
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();

        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedTo(e);
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Ensure that every object you want to be preserved has a &lt;b&gt;Name&lt;/b&gt; specified.&lt;br /&gt;The code below is from &amp;quot;TextBoxes.xaml&amp;quot; in the demo project included with the source. It shows three textboxes, the middle of which won&amp;#39;t have it&amp;#39;s text automatically preserved during tombstoning.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;second (doesn&amp;#39;t have name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;That&amp;#39;s it!&lt;br /&gt;
&lt;h2&gt;Slightly more advanced usage&lt;/h2&gt;
If you want to improve performance you can specify only the types of the controls which you want to be preserved when calling &lt;b&gt;SaveState()&lt;/b&gt;.&lt;br /&gt;eg:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;or&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
&lt;/pre&gt;&lt;/div&gt;or in a more generic style&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState&amp;lt;ScrollViewer&amp;gt;();
&lt;/pre&gt;&lt;/div&gt;or&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState&amp;lt;ListBox, TextBox&amp;gt;();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Not only does this improve performance but it makes it easy to integrate this functionality to save some properties (typically the scroll position of a ListBox or ScrolViewer) where there is already a view model which preserves the data state.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Adding support for other types&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Add a new class to the project which implements &lt;b&gt;ICanTombstone&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Add the necessary code to implement the functionality. N.B. The key used for saving the state of the object should be a string comprising the name of the type and the name of the object separated by a &amp;#39;^&amp;#39; character.&lt;/li&gt;
&lt;li&gt;Add appropriate entries to &lt;i&gt;AllTombstoneRestorers()&lt;/i&gt; and &lt;i&gt;AllSupportedTombstoners()&lt;/i&gt; in &amp;quot;PhoneApplicationPageExtensions.cs&amp;quot;.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;If you are adding support for additional types then reviewing the exising implementations of &lt;b&gt;ICanTombstone&lt;/b&gt; is highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Gotchas&lt;/h1&gt;
You &lt;i&gt;may&lt;/i&gt; experience strange behaviour or unwanted side effects in the following situations&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have an event that is triggered upon setting the property that automatically preserved. e.g. If it&amp;#39;s a TextBox and you&amp;#39;re handling the &lt;i&gt;TextChanged&lt;/i&gt; event—it may have too account for it being triggered additional times.&lt;/li&gt;
&lt;li&gt;If you are databinding the property which is has events or actions in response to setting it.&lt;/li&gt;
&lt;li&gt;If you are generating the UI in code at runtime. &lt;/li&gt;
&lt;li&gt;If you are also doing something with the State object yourself then do it &lt;b&gt;after&lt;/b&gt; calling SaveState() as it will clear the contents of the state object to ensure it doen&amp;#39;t have anything more than it needs in it.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If one of these scenarios does cause a problem then get in touch as there may be a workaround.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Fri, 29 Jul 2011 21:05:49 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110729090549P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tombstonehelper.codeplex.com/documentation?version=8</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Contents&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Adding support for other types&lt;/li&gt;
&lt;li&gt;Gotchas&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Download the library&lt;/li&gt;
&lt;li&gt;Add a reference to it in your project&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;Or use NuGet: &lt;a href="http://www.nuget.org/List/Packages/WP7TombstoneHelper" class="externalLink"&gt;http://www.nuget.org/List/Packages/WP7TombstoneHelper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;
&lt;h2&gt;Simple usage&lt;/h2&gt;
Include a reference to the namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; TombstoneHelper;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;In any pages that have something you may want to preserve during tombstoning, simply call &lt;b&gt;SaveState(e)&lt;/b&gt; in the &lt;b&gt;OnNavigatingFrom&lt;/b&gt; handler and &lt;b&gt;RestoreState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedTo&lt;/b&gt; handler.&lt;br /&gt;&lt;i&gt;&lt;b&gt;Note&lt;/b&gt; that I&amp;#39;m using OnNavingat&lt;b&gt;ing&lt;/b&gt;From method, rather than OnNavigat&lt;b&gt;ed&lt;/b&gt;From, as it allows us to detect the direction of navigation. This means we don&amp;#39;t save state if we know we won&amp;#39;t need it again. This can help improve the performance of the app.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(e); 

        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedFrom();
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();

        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedTo(e);
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Ensure that every object you want to be preserved has a &lt;b&gt;Name&lt;/b&gt; specified.&lt;br /&gt;The code below is from &amp;quot;TextBoxes.xaml&amp;quot; in the demo project included with the source. It shows three textboxes, the middle of which won&amp;#39;t have it&amp;#39;s text automatically preserved during tombstoning.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;second (doesn&amp;#39;t have name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;That&amp;#39;s it!&lt;br /&gt;
&lt;h2&gt;Slightly more advanced usage&lt;/h2&gt;
If you want to improve performance you can specify only the types of the controls which you want to be preserved when calling &lt;b&gt;SaveState()&lt;/b&gt;.&lt;br /&gt;eg:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;or&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Not only does this improve performance but it makes it easy to integrate this functionality to save some properties (typically the scroll position of a ListBox or ScrolViewer) where there is already a view model which preserves the data state.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Adding support for other types&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Add a new class to the project which implements &lt;b&gt;ICanTombstone&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Add the necessary code to implement the functionality. N.B. The key used for saving the state of the object should be a string comprising the name of the type and the name of the object separated by a &amp;#39;^&amp;#39; character.&lt;/li&gt;
&lt;li&gt;Add appropriate entries to &lt;i&gt;AllTombstoneRestorers()&lt;/i&gt; and &lt;i&gt;AllSupportedTombstoners()&lt;/i&gt; in &amp;quot;PhoneApplicationPageExtensions.cs&amp;quot;.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;If you are adding support for additional types then reviewing the exising implementations of &lt;b&gt;ICanTombstone&lt;/b&gt; is highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Gotchas&lt;/h1&gt;
You &lt;i&gt;may&lt;/i&gt; experience strange behaviour or unwanted side effects in the following situations&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have an event that is triggered upon setting the property that automatically preserved. e.g. If it&amp;#39;s a TextBox and you&amp;#39;re handling the &lt;i&gt;TextChanged&lt;/i&gt; event—it may have too account for it being triggered additional times.&lt;/li&gt;
&lt;li&gt;If you are databinding the property which is has events or actions in response to setting it.&lt;/li&gt;
&lt;li&gt;If you are generating the UI in code at runtime. &lt;/li&gt;
&lt;li&gt;If you are also doing something with the State object yourself then do it &lt;b&gt;after&lt;/b&gt; calling SaveState() as it will clear the contents of the state object to ensure it doen&amp;#39;t have anything more than it needs in it.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If one of these scenarios does cause a problem then get in touch as there may be a workaround.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Fri, 29 Jul 2011 20:37:03 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110729083703P</guid></item><item><title>Updated Wiki: Home</title><link>http://tombstonehelper.codeplex.com/wikipage?version=11</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Tombstoning support just got REALLY simple!&lt;/h1&gt;
This library adds extension methods to PhoneApplicationPage so you don&amp;#39;t have to worry about maintaining the state of a page in your app if it gets tombstoned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;It just takes 2 lines of code!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedFrom(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState();  &lt;span style="color:Green;"&gt;// &amp;lt;- first line&lt;/span&gt;
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedTo(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();  &lt;span style="color:Green;"&gt;// &amp;lt;- second line&lt;/span&gt;
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;If you add the above to your code then the &lt;i&gt;contents, checked state and scroll positions&lt;/i&gt; of &lt;b&gt;TextBoxes&lt;/b&gt;, &lt;b&gt;PasswordBoxes&lt;/b&gt;, &lt;b&gt;CheckBoxes&lt;/b&gt;, &lt;b&gt;RadioButtons&lt;/b&gt;, &lt;b&gt;Sliders&lt;/b&gt;, &lt;b&gt;ListBoxes&lt;/b&gt; and &lt;b&gt;ScrollViewers&lt;/b&gt; will be preserved.&lt;br /&gt;&lt;br /&gt;If you want to add support for other types this can be done as the code was designed to be &lt;i&gt;&lt;b&gt;easily extensible&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The code is &lt;i&gt;&lt;b&gt;optimised for performance&lt;/b&gt;&lt;/i&gt; but if you don&amp;#39;t use all of those types on your page you can get even better performance by just specifying the types of the objects you wish to save the state of:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
or 
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;Yes. It&amp;#39;s reallly that simple.&lt;/b&gt;&lt;/h2&gt;You just need to make sure you&amp;#39;re given a name to the object you wish to save the state of.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;thisHasANameAndSoWillBeSaved&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Please note that there are much better ways of using it. See the &lt;a href="http://tombstonehelper.codeplex.com/documentation?referringTitle=Home"&gt;Documentation&lt;/a&gt; page for more details.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;All feedback, comments, questions, etc. greatly appreciated.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Fri, 29 Jul 2011 20:29:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20110729082944P</guid></item><item><title>Updated Wiki: Roadmap</title><link>http://tombstonehelper.codeplex.com/wikipage?title=Roadmap&amp;version=1</link><description>&lt;div class="wikidoc"&gt;The following are ideas for adding to future versions of this library. No promises that any of these will make it in but just a record of what I&amp;#39;m thinking about.&lt;br /&gt;If you&amp;#39;ve got a particular desire to see any of these with increased priority or if there&amp;#39;s anythign you think should be added then please let me know.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;better handling for custom handlers (having to specify them on restore  as well as save is far from ideal)&lt;/li&gt;
&lt;li&gt;support for maps control?&lt;/li&gt;
&lt;li&gt;support for mediaelement&lt;/li&gt;
&lt;li&gt;add support for callbacks on restore which are set at save&lt;/li&gt;
&lt;li&gt;example handlers for all controls in the toolkit&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Mon, 16 May 2011 20:27:39 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Roadmap 20110516082739P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tombstonehelper.codeplex.com/documentation?version=7</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Contents&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Adding support for other types&lt;/li&gt;
&lt;li&gt;Gotchas&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Download the library&lt;/li&gt;
&lt;li&gt;Add a reference to it in your project&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;Or use NuGet: &lt;a href="http://www.nuget.org/List/Packages/WP7TombstoneHelper" class="externalLink"&gt;http://www.nuget.org/List/Packages/WP7TombstoneHelper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;
&lt;h2&gt;Simple usage&lt;/h2&gt;
Include a reference to the namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; TombstoneHelper;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;In any pages that have something you may want to preserve during tombstoning, simply call &lt;b&gt;SaveState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedFrom&lt;/b&gt; handler and &lt;b&gt;RestoreState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedTo&lt;/b&gt; handler.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedFrom(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(); 
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedTo(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Ensure that every object you want to be preserved has a &lt;b&gt;Name&lt;/b&gt; specified.&lt;br /&gt;The code below is from &amp;quot;TextBoxes.xaml&amp;quot; in the demo project included with the source. It shows three textboxes, the middle of which won&amp;#39;t have it&amp;#39;s text automatically preserved during tombstoning.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;second (doesn&amp;#39;t have name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;That&amp;#39;s it!&lt;br /&gt;
&lt;h2&gt;Slightly more advanced usage&lt;/h2&gt;
If you want to improve performance you can specify only the types of the controls which you want to be preserved when calling &lt;b&gt;SaveState()&lt;/b&gt;.&lt;br /&gt;eg:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;or&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Not only does this improve performance but it makes it easy to integrate this functionality to save some properties (typically the scroll position of a ListBox or ScrolViewer) where there is already a view model which preserves the data state.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Adding support for other types&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Add a new class to the project which implements &lt;b&gt;ICanTombstone&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Add the necessary code to implement the functionality. N.B. The key used for saving the state of the object should be a string comprising the name of the type and the name of the object separated by a &amp;#39;^&amp;#39; character.&lt;/li&gt;
&lt;li&gt;Add appropriate entries to &lt;i&gt;AllTombstoneRestorers()&lt;/i&gt; and &lt;i&gt;AllSupportedTombstoners()&lt;/i&gt; in &amp;quot;PhoneApplicationPageExtensions.cs&amp;quot;.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;If you are adding support for additional types then reviewing the exising implementations of &lt;b&gt;ICanTombstone&lt;/b&gt; is highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Gotchas&lt;/h1&gt;
You &lt;i&gt;may&lt;/i&gt; experience strange behaviour or unwanted side effects in the following situations&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have an event that is triggered upon setting the property that automatically preserved. e.g. If it&amp;#39;s a TextBox and you&amp;#39;re handling the &lt;i&gt;TextChanged&lt;/i&gt; event—it may have too account for it being triggered additional times.&lt;/li&gt;
&lt;li&gt;If you are databinding the property which is has events or actions in response to setting it.&lt;/li&gt;
&lt;li&gt;If you are generating the UI in code at runtime. &lt;/li&gt;
&lt;li&gt;If you are also doing something with the State object yourself then do it &lt;b&gt;after&lt;/b&gt; calling SaveState() as it will clear the contents of the state object to ensure it doen&amp;#39;t have anything more than it needs in it.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If one of these scenarios does cause a problem then get in touch as there may be a workaround.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Thu, 14 Apr 2011 11:30:14 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110414113014A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tombstonehelper.codeplex.com/documentation?version=6</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Contents&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Adding support for other types&lt;/li&gt;
&lt;li&gt;Gotchas&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Download the library&lt;/li&gt;
&lt;li&gt;Add a reference to it in your project&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;Or use NuGet: &lt;a href="http://www.nuget.org/List/Packages/WP7TombstoneHelper" class="externalLink"&gt;http://www.nuget.org/List/Packages/WP7TombstoneHelper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;
&lt;h2&gt;Simple usage&lt;/h2&gt;
Include a reference to the namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; TombstoneHelper;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;In any pages that have something you may want to preserve during tombstoning, simply call &lt;b&gt;SaveState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedFrom&lt;/b&gt; handler and &lt;b&gt;RestoreState()&lt;/b&gt; in the &lt;b&gt;OnNavigatedTo&lt;/b&gt; handler.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedFrom(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(); 
    }

    &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        &lt;span style="color:Blue;"&gt;base&lt;/span&gt;.OnNavigatedTo(e);

        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.RestoreState();
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Ensure that every object you want to be preserved has a &lt;b&gt;Name&lt;/b&gt; specified.&lt;br /&gt;The code below is from &amp;quot;TextBoxes.xaml&amp;quot; in the demo project included with the source. It shows three textboxes, the middle of which won&amp;#39;t have it&amp;#39;s text automatically preserved during tombstoning.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;first&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;second (doesn&amp;#39;t have name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;&amp;lt;!--This TextBox does not have a name so it&amp;#39;s contents won&amp;#39;t be automatically saved and restored --&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:Red;"&gt;Text&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third (has name)&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#A31515;"&gt;TextBox&lt;/span&gt; &lt;span style="color:Red;"&gt;Name&lt;/span&gt;&lt;span style="color:Blue;"&gt;=&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:Blue;"&gt;third&lt;/span&gt;&lt;span style="color:Black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:Blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;That&amp;#39;s it!&lt;br /&gt;
&lt;h2&gt;Slightly more advanced usage&lt;/h2&gt;
If you want to improve performance you can specify only the types of the controls which you want to be preserved when calling &lt;b&gt;SaveState()&lt;/b&gt;.&lt;br /&gt;eg:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(TextBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(PasswordBox), &lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(CheckBox));
&lt;/pre&gt;&lt;/div&gt;or&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.SaveState(&lt;span style="color:Blue;"&gt;typeof&lt;/span&gt;(ScrollViewer));
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Not only does this improve performance but it makes it easy to integrate this functionality to save some properties (typically the scroll position of a ListBox or ScrolViewer) where there is already a view model which preserves the data state.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Adding support for other types&lt;/h1&gt;
&lt;ol&gt;&lt;li&gt;Add a new class to the project which implements &lt;b&gt;ICanTombstone&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Add the necessary code to implement the functionality. N.B. The key used for saving the state of the object should be a string comprising the name of the type and the name of the object separated by a &amp;#39;^&amp;#39; character.&lt;/li&gt;
&lt;li&gt;Add appropriate entries to &lt;i&gt;AllTombstoneRestorers()&lt;/i&gt; and &lt;i&gt;AllSupportedTombstoners()&lt;/i&gt; in &amp;quot;PhoneApplicationPageExtensions.cs&amp;quot;.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;If you are adding support for additional types then reviewing the exising implementations of &lt;b&gt;ICanTombstone&lt;/b&gt; is highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Gotchas&lt;/h1&gt;
You &lt;i&gt;may&lt;/i&gt; experience strange behaviour or unwanted side effects in the following situations&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have an event that is triggered upon setting the property that automatically preserved. e.g. If it&amp;#39;s a TextBox and you&amp;#39;re handling the &lt;i&gt;TextChanged&lt;/i&gt; event—it may have too account for it being triggered additional times.&lt;/li&gt;
&lt;li&gt;If you are databinding the property which is has events or actions in response to setting it.&lt;/li&gt;
&lt;li&gt;If you are generating the UI in code at runtime. &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If one of these scenarios does cause a problem then get in touch as there may be a workaround.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>mrlacey</author><pubDate>Sat, 26 Mar 2011 11:11:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110326111131A</guid></item></channel></rss>