<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Derik Whittaker : WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx</link><description>Tags: WP7</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Help my Secondary Tile will not navigate correctly in my Win Phone Application</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/25/help-my-secondary-tile-will-not-navigate-correctly-in-my-win-phone-application.aspx</link><pubDate>Sun, 26 Aug 2012 01:15:21 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70294</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70294</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70294</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/25/help-my-secondary-tile-will-not-navigate-correctly-in-my-win-phone-application.aspx#comments</comments><description>&lt;p&gt;When you are adding the ability to have a Secondary tile to your Windows phone application you may from time to time find the need to debug or mimic the launching of the application via the Secondary tile w/ the correct query string values. Sadly, debugging this via the debugger is not something that I have found out how to do, if it is possible please let me know.&amp;nbsp; However, I have found another way to get the same result and here is how.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Get the exact tile uri used for the secondary tile.&lt;br /&gt;Example: “/views/events/Landing.xaml?Id=1”&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Open up the WMAppManifest.xml page under resources&lt;/li&gt; &lt;li&gt;Find the line that looks like this:&lt;br /&gt;&amp;lt;DefaultTask Name=&amp;quot;_default&amp;quot; NavigationPage=&amp;quot;MainPage.xaml&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Replace it w/ the URI of your secondary tile like this:&lt;br /&gt;&amp;lt;DefaultTask Name=&amp;quot;_default&amp;quot; NavigationPage=&amp;quot;/views/events/Landing.xaml?Id=1&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Launch the application&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;If you are wired everything correctly your page should load, but if you are trying to debug this it is likely you did not have everything correct.&amp;nbsp; If you did not do things correctly you should get some sort of runtime error.&lt;/p&gt; &lt;p&gt;Hope this helps&lt;/p&gt; &lt;p&gt;Till next time,&lt;/p&gt;&lt;pre&gt;
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70294" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>Data Binding to the Panorama control in WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/22/data-binding-to-the-panorama-control-in-wp7.aspx</link><pubDate>Wed, 22 Aug 2012 18:56:59 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70290</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70290</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70290</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/22/data-binding-to-the-panorama-control-in-wp7.aspx#comments</comments><description>&lt;p&gt;When you build a Windows Phone 7 (soon to be 8) application, one of the screen layouts you can use is the Panorama.&amp;#160; In most cases the number of pages in the panorama is hard defined in code but there is the occasion when you will add pages dynamically&amp;#160; based on binding.&amp;#160; In this post we are going to take a look at how we can do this.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1 – Setup the ItemSource binding&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As with all other binding to list items you can setup your ItemSource binding&amp;#160; as below:&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;ItemsSource=&amp;quot;{Binding SportDrills}&amp;quot; &lt;/pre&gt;

&lt;p&gt;The SportDrills is simply a property off of my main VM and it contains the needed data for both the header and item template&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 – Setup the Header DataTemplate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When setting up the Panorama it is important to have a header, binding to this header is not too hard and only requires a few lines of xaml&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;&amp;lt;controls:Panorama.HeaderTemplate&amp;gt;
    &amp;lt;DataTemplate&amp;gt;
        &amp;lt;Grid&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
                &amp;lt;RowDefinition Height=&amp;quot;auto&amp;quot; /&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;{Binding SportName}&amp;quot; /&amp;gt;
            &amp;lt;TextBlock Grid.Row=&amp;quot;1&amp;quot; Text=&amp;quot;{Binding DrillCount}&amp;quot; 
                        Margin=&amp;quot;15,3&amp;quot;
                        Style=&amp;quot;{StaticResource PanaramaHeaderAccentTextBlockStyle}&amp;quot; /&amp;gt;
        &amp;lt;/Grid&amp;gt;
    v/DataTemplate&amp;gt;
&amp;lt;/controls:Panorama.HeaderTemplate&amp;gt;&lt;/pre&gt;

&lt;p&gt;In the xaml above the important part to pay attention to is the Panorama.HeaderTemplate, this is where you can define you header for the given panel.&amp;#160; In my example I am creating a bit more complex header as i am adding a second level of data.&amp;#160; If you only want a single line of text of course you can skip the grid and just have a TextBlock statement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3 – Setup the ItemTemplate DataTemplate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our header setup it is time to setup the body of the panel.&amp;#160; To do this you will want to do something like below.&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;&amp;lt;controls:Panorama.ItemTemplate&amp;gt;:               
    &amp;lt;DataTemplate&amp;gt;:
        &amp;lt;Grid&amp;gt;:
            &amp;lt;ListBox Margin=&amp;quot;0,0,-12,0&amp;quot; ItemsSource=&amp;quot;{Binding Drills}&amp;quot;                          
						telerik:InteractionEffectManager.IsInteractionEnabled=&amp;quot;True&amp;quot; 
						ItemContainerStyle=&amp;quot;{StaticResource StretchableListBoxItemStyle}&amp;quot;&amp;gt;:

                &amp;lt;ListBox.ItemTemplate&amp;gt;:
                    &amp;lt;DataTemplate&amp;gt;:
                        &amp;lt;Grid&amp;gt;:
                            &amp;lt;Border 
							VerticalAlignment=&amp;quot;Center&amp;quot;
							HorizontalAlignment=&amp;quot;Center&amp;quot;
							Width=&amp;quot;36&amp;quot; Height=&amp;quot;36&amp;quot;&amp;gt;:

                            &amp;lt;/Border&amp;gt;:
                            &amp;lt;TextBlock Grid.Column=&amp;quot;1&amp;quot; Grid.Row=&amp;quot;0&amp;quot; Text=&amp;quot;{Binding Name}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; Style=&amp;quot;{StaticResource ListBoxHeaderStyle}&amp;quot;/&amp;gt;:

                        &amp;lt;/Grid&amp;gt;:
                    &amp;lt;/DataTemplate&amp;gt;:
                &amp;lt;/ListBox.ItemTemplate&amp;gt;:
            &amp;lt;/ListBox&amp;gt;:
        &amp;lt;/Grid&amp;gt;:
    &amp;lt;/DataTemplate&amp;gt;:
&amp;lt;/controls:Panorama.ItemTemplate&amp;gt;:&lt;/pre&gt;

&lt;p&gt;In the XAML above the important part to pay attention to is the Panorama.ItemTemplate, this is where you can defined your content for the panel.&amp;#160; In my example I am simply listing data, but you can of course do anything you want.&lt;/p&gt;

&lt;p&gt;As you can see binding to the ItemSource and creating panels on the fly via binding is very simple, yet very powerful&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70290" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>Using SQL CE On WP7 Mango–Working with Indexes</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/24/using-sql-ce-on-wp7-mango-working-with-indexes.aspx</link><pubDate>Sun, 24 Jul 2011 19:58:26 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68024</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68024</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68024</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/24/using-sql-ce-on-wp7-mango-working-with-indexes.aspx#comments</comments><description>&lt;p&gt;This is another post in a series of posts on how to use SQL CE on WP7 Mango.&amp;#160; If you would like to see the other posts they are listed below&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/21/using-sql-ce-on-wp7-mango-getting-started.aspx"&gt;Using SQL CE on WP7 Mango–Getting Started&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/23/using-sql-ce-on-wp7-mango-working-with-associations.aspx"&gt;Using SQL CE On WP7 Mango–Working with Associations&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Using SQL CE On WP7 Mango–Working with Indexes&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In this posting we will take a deeper look at how we can setup and use indexes on our SQL CE database table.&amp;#160; Using Indexes inside of WP7 for SQL CE follows the same basic pattern as setting up &lt;a href="http://msdn.microsoft.com/en-us/library/bb534395.aspx"&gt;Tables&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.aspx"&gt;Columns&lt;/a&gt; which means that we are going to introduce a new attribute called [&lt;a href="http://msdn.microsoft.com/en-us/library/hh133490%28v=VS.96%29.aspx"&gt;Index&lt;/a&gt;].&amp;#160; The only difference is that this attribute is not part of the System.Data.Linq.Mapping namespace, but rather part of the &lt;a href="http://msdn.microsoft.com/en-us/library/hh133488%28v=VS.96%29.aspx"&gt;Microsoft.Phone.Data.Linq.Mapping&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;When setting up an index there is 2 things that this index can do&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Help speed up your queries &lt;/li&gt;    &lt;li&gt;Provide the ability to enforce unique constraints&amp;#160; on your data &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Step 1: Adding reference to the correct namespace&lt;/p&gt;  &lt;p&gt;You will need to add a reference to &lt;a href="http://msdn.microsoft.com/en-us/library/hh133488%28v=VS.96%29.aspx"&gt;Microsoft.Phone.Data.Linq.Mapping&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Defining your index&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When setting up your index you of course will need to use the [Index] attribute, but this attribute does NOT go at the column level, but rather at the table level. And since the Index attribute is setup as AllowMultiple == true you have the ability to setup many indexes for a given table&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;[Index(Columns = &amp;quot;Name&amp;quot;, Name = &amp;quot;i_Name&amp;quot;)]
[Index(Columns = &amp;quot;Name, Number&amp;quot;, Name = &amp;quot;i_Name_Number&amp;quot;)]
[Table]
public class Episode
{
	// blah, blah, blah
}&lt;/pre&gt;

&lt;p&gt;Taking a deeper look at the code above there is a few items we should point out&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.data.linq.mapping.indexattribute.name(v=VS.96).aspx"&gt;Name&lt;/a&gt; Property - Gets or sets the name of the index &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.data.linq.mapping.indexattribute.columns(v=VS.96).aspx"&gt;Columns&lt;/a&gt; Property - Gets or sets the columns on which the index is based. 

    &lt;ol&gt;
      &lt;li&gt;Indexing Multiple Columns: This is done by putting a ‘,’ between the names of the columns.&amp;#160; This MUST be a comma otherwise you will get a InvalidOperationException and it will tell you it cannot find the key Member [ColumnNameHere] &lt;/li&gt;

      &lt;li&gt;If you fat finger or misspell a column when setting up your index you will also get an exception of type -- InvalidOperationException and it will tell you it cannot find the key Member [ColumnNameHere] &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Adding the unique constraint to your index&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now adding an index for performance reasons is one thing, but adding it to enforce unique constraints is s a very powerful feature.&amp;#160; Fortunattly adding uniqueness to an index is CAKE, you simply add the IsUnique property as below&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[Index(Columns = &amp;quot;TagName&amp;quot;, Name = &amp;quot;i_TagName&amp;quot;, IsUnique = true)]
[Table]
public class EpisodeTag
{
	// blah, blah, blah
}&lt;/pre&gt;

&lt;p&gt;Now that you have added the uniqueness constraint you must be careful because if/when you try to save data into that column that violates the constraint you will receive an exception as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_5588A5B4.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_09BCCEFB.png" width="456" height="256" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see working with indexes in SQL CE on WP7 mango is pretty easy and pretty powerful.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68024" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/SQL+CE+3.5/default.aspx">SQL CE 3.5</category></item><item><title>Using SQL CE On WP7 Mango–Working with Associations</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/23/using-sql-ce-on-wp7-mango-working-with-associations.aspx</link><pubDate>Sat, 23 Jul 2011 18:20:36 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68020</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68020</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68020</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/23/using-sql-ce-on-wp7-mango-working-with-associations.aspx#comments</comments><description>&lt;p&gt;This is another post in a series of posts on how to use SQL CE on WP7 Mango.&amp;#160; If you would like to see the other posts they are listed below&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/21/using-sql-ce-on-wp7-mango-getting-started.aspx"&gt;Using SQL CE on WP7 Mango–Getting Started&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/23/using-sql-ce-on-wp7-mango-working-with-associations.aspx"&gt;Using SQL CE On WP7 Mango–Working with Associations&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/24/using-sql-ce-on-wp7-mango-working-with-indexes.aspx"&gt;Using SQL CE On WP7 Mango–Working with Indexes&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In my &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/21/using-sql-ce-on-wp7-mango-getting-started.aspx"&gt;first&lt;/a&gt; post we took a step by step look at how to get up and running using SQL CE inside of your WP7 Mango Application.&amp;#160; However, in that previous post I showed you how to get up and running on a database with only 1 column and we all know that most production database have at least 2 tables : )&amp;#160; &lt;/p&gt;  &lt;p&gt;In this post we will focus on how to add additional tables to the mix and how to setup relationships between these tables.&lt;/p&gt;  &lt;p&gt;In my prior post I setup my Episode model as below&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;using System.Data.Linq;
using System.Data.Linq.Mapping;

[Table]
public class Episode
{
    [Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = &amp;quot;INT NOT NULL&amp;quot;, CanBeNull = false)]
    public Int32 Id { get; set; }

    [Column]
    public Int32 Number { get; set; }

    [Column]
    public string Name { get; set; }
   
}&lt;/pre&gt;
In this post we want to create an additional model called EpisodeTag.&amp;#160; This will add a 0 to N relationship between Episodes and EpisodeTag 

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_0A0454CA.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_3785748D.png" width="364" height="207" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[Table]
public class EpisodeTag
{
    [Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = &amp;quot;INT NOT NULL&amp;quot;, CanBeNull = false)]
    public Int32 Id { get; set; }

    [Column]
    public string TagName { get; set; }
 
}&lt;/pre&gt;

&lt;p&gt;Now that we know the basic layout of the 2 models how do go about setting up the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.aspx"&gt;Association&lt;/a&gt; between them?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Update our Datacontext to have a pointer to the new [&lt;/strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.tableattribute.aspx"&gt;&lt;strong&gt;Table&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;] (aka model)&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public class DimecastsDataContext : DataContext
{
    public DimecastsDataContext() : base(&amp;quot;Data Source=isostore:/DimecastsData.sdf&amp;quot;)
    {

    }

    public Table&amp;lt;Episode&amp;gt; Episodes;

    public Table&amp;lt;EpisodeTag&amp;gt; EpisodeTags;&lt;/pre&gt;

&lt;p&gt;The change in the context is the addition of the new EpisodeTags table pointer.&amp;#160; If you do not add this you will get a S&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/20/sqlceexception-the-specified-table-does-not-exist-tablenamehere.aspx"&gt;qlCEException – Table not found error&lt;/a&gt; when you try to access information in this table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Setup the Association between Episode and Episode Tag (parent down to child)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have added the table pointer in our datacontext the next thing we need to do is actually setup our pointers and mappings from Episode to EpisodeTags.&amp;#160; The code below is the final model showing the needed attributes.&amp;#160; &lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[Table]
public class Episode
{
    [Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = &amp;quot;INT NOT NULL&amp;quot;, CanBeNull = false)]
    public Int32 Id { get; set; }

    [Column]
    public Int32 Number { get; set; }

    [Column]
    public string Name { get; set; }
        
    private EntitySet&amp;lt;EpisodeTag&amp;gt; _episodeTags = new EntitySet&amp;lt;EpisodeTag&amp;gt;();

    [Association(Storage = &amp;quot;_episodeTags&amp;quot;, OtherKey = &amp;quot;_episodeId&amp;quot;, ThisKey = &amp;quot;Id&amp;quot;)]
    public EntitySet&amp;lt;EpisodeTag&amp;gt; EpisodeTags
    {
        get { return _episodeTags; }
        set { _episodeTags.Assign(value); }
    }
}&lt;/pre&gt;

&lt;p&gt;Lets take a look at what changes were made to this model.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Addition of the EntitySet&amp;lt;EpisodeTag&amp;gt; property 
    &lt;ul&gt;
      &lt;li&gt;This will allow us to navigate from the Episode (Parent) to the EpisodeTag (Child) objects &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Addition of the EntitySet&amp;lt;EpisodeTag&amp;gt; private backing field 
    &lt;ul&gt;
      &lt;li&gt;This backing field is what will be set by the database engine when building the object graph, set via the ‘Storage’ property &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Addition of the [Association] attribute 
    &lt;ol&gt;
      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.dataattribute.storage.aspx"&gt;Storage&lt;/a&gt; Property - Gets or sets a private storage field to hold the value from a column. &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.otherkey.aspx"&gt;OtherKey&lt;/a&gt; (aka Foreign Key) Property - Gets or sets one or more members of the target entity class as key values on the other side of the association &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.thiskey.aspx"&gt;ThisKey&lt;/a&gt; (aka Primary Key) Property - Gets or sets members of this entity class to represent the key values on this side of the association &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Setup the Association between EpisodeTag and Episode (child backwards to parent)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we can walk from the Episode (parent) to the child (EpisodeTag) we need to setup the ability to from the opposite direction.&amp;#160; In the code below we do exactly that.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[Table]
public class EpisodeTag
{
    [Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = &amp;quot;INT NOT NULL&amp;quot;, CanBeNull = false)]
    public Int32 Id { get; set; }

    [Column]
    public string TagName { get; set; }

    [Column]
    internal int? _episodeId;

    private EntityRef _episode;

    [Association(Storage = &amp;quot;_episode&amp;quot;, ThisKey = &amp;quot;_episodeId&amp;quot;, OtherKey = &amp;quot;Id&amp;quot;, IsForeignKey = true)]
    public Episode Episode
    {
        get { return _episode.Entity; }
        set { _episode.Entity = value; }
    }       
}&lt;/pre&gt;

&lt;p&gt;Lets take a look at what we added, but as you may have already noticed this code is VERY similar to the code needed for Episode.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Addition of the Episode property 
    &lt;ul&gt;
      &lt;li&gt;This allows us to walk the object tree backwards to get to the parent &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Addition of the EpisodeID backing field 
    &lt;ul&gt;
      &lt;li&gt;Since the DB Table needs to hold the ID this is how this is accomplished. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Addition of the Episode EntityRef property 
    &lt;ul&gt;
      &lt;li&gt;This is an object pointer which is based off the _episdoeId backing field &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Addition of the [Association] attribute to the Episode Property 
    &lt;ol&gt;
      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.dataattribute.storage.aspx"&gt;Storage&lt;/a&gt; Property - Gets or sets a private storage field to hold the value from a column &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.otherkey.aspx"&gt;OtherKey&lt;/a&gt; (aka Foreign Key) Property - Gets or sets one or more members of the target entity class as key values on the other side of the association &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.thiskey.aspx"&gt;ThisKey&lt;/a&gt; (aka Primary Key) Property - Gets or sets members of this entity class to represent the key values on this side of the association &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.associationattribute.isforeignkey.aspx"&gt;IsForeignKey&lt;/a&gt; Property - Gets or sets the member as the foreign key in an association representing a database relationship &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that we have our mappings setup to allow for bi-directional mapping lets take a look at how we can use these mappings to insert data as well as query for exisiting data&lt;/p&gt;

&lt;p&gt;How to insert data&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;var newEpisode = new Episode
    {
        Id = 1,
        Number = 1,
        Name = &amp;quot;Something Cool&amp;quot;,
        EpisodeTags = new EntitySet
                            {
                                new EpisodeTag {Id = 1, TagName = &amp;quot;Tag&amp;quot;},
                                new EpisodeTag {Id = 2, TagName = &amp;quot;Tag&amp;quot;}
                            }
    };&lt;/pre&gt;

&lt;p&gt;How to query data&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;var episodes = from e in DimecastsDataContext.Episodes
                           select e;&lt;/pre&gt;

&lt;p&gt;There you have it all the information need to understand how to setup an Association between 2 tables (models) inside of Sql CE.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68020" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/SQL+CE+3.5/default.aspx">SQL CE 3.5</category></item><item><title>Using SQL CE on WP7 Mango–Getting Started</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/21/using-sql-ce-on-wp7-mango-getting-started.aspx</link><pubDate>Thu, 21 Jul 2011 21:52:23 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68015</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68015</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68015</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/21/using-sql-ce-on-wp7-mango-getting-started.aspx#comments</comments><description>&lt;p&gt;One of the major new ‘features’ of WP7 Mango is the addition of &lt;a href="http://msdn.microsoft.com/en-us/library/hh202860%28v=VS.92%29.aspx"&gt;SQL CE 3.5&lt;/a&gt; support.&amp;#160; Prior to Mango CE was loaded on the phone but 3rd party applications (the ones you and I write) were not able to access it.&amp;#160; With Mango this has all changed and CE is not a full first class citizen.&amp;#160; If you have never used CE before (myself included) than you will find it a bit different to use, but this is mostly due to the way you have to setup and define your tables via code.&amp;#160; &lt;/p&gt;  &lt;p&gt;In this post I will walk you though the steps on how to setup a very simple database on CE.&amp;#160; In future posts we will dive deeper and learn how to use some of CE’s more complex features.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1: Installing SQL CE via Nuget&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Before we start writing a line of code we need to install/reference the SQL CE assemblies.&amp;#160; The easiest way is to open the &lt;a href="http://nuget.org/"&gt;Package Manager Console for Nuget&lt;/a&gt; and type Install-Package SqlServerCompact.&amp;#160; This will download the latest CE assemblies and add them to your project.&amp;#160; &lt;/p&gt;  &lt;p&gt;Your Nuget window should look like:    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_5E585592.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_0FE3C328.png" width="561" height="162" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once you have SQL CE installed you should have the following references added to your project:    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_6F5C8375.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_55F4803B.png" width="359" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ok, now you are done with the setup and you can start coding away.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Creating and setting up the Data Context&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Per MSDN the DataContext is&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The data context is a proxy, an object that represents the database. A data context contains Table objects, each of which represents a table in the database. Each Table object is made up of entities that correspond to rows of data in a database. Each entity is a “plain old CLR object” (POCO) with attributes. The attributes on each entity determine the database table structure and define the mapping between the object model of the data and the schema of the database. For example, an entity having Name and PhoneNumber properties would result in a database table having Name and PhoneNumber columns. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In short this is your &amp;#39;Database In Code’.&amp;#160; You will need to create this and have it in memory for the duration of the run of your application.&amp;#160; Below is the code we are going to use to create our data context&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;using System.Data.Linq;

public class DimecastsDataContext : DataContext
{
    public DimecastsDataContext() : base(&amp;quot;Data Source=isostore:/DimecastsData.sdf&amp;quot;)
    {

    }

    public Table&amp;lt;Episode&amp;gt; Episodes;

}&lt;/pre&gt;

&lt;p&gt;You will notice that my context class is very small, this is a good thing.&amp;#160; There are a few items in this class which are worth pointing out&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The ‘Connection String’ – This is needed in order to tell CE where to find the data stored in isolated storage.&amp;#160; In my example I am hard wiring it into the constructor call. &lt;/li&gt;

  &lt;li&gt;The Table&amp;lt;ENTITY&amp;gt; field – This tells the Data Context that there is going to be a table defined, and accessed, which is of type Episode.&amp;#160; This is required.&amp;#160; If you fail to create this you will receive a &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2011/07/20/sqlceexception-the-specified-table-does-not-exist-tablenamehere.aspx"&gt;SQLCEException – Table does not exist error&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;No place in code will you set a pointer to the Episodes ‘table’ this is done via black magic by the DataContext.&amp;#160; Its odd I know but trust me it just works. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Creating our entity which represents our Table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we can actually start creating any ‘real’ code we must define an entity (Episode) which represents our table structure.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;using System.Data.Linq;
using System.Data.Linq.Mapping;

[Table]
public class Episode
{
    [Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = &amp;quot;INT NOT NULL&amp;quot;, CanBeNull = false)]
    public Int32 Id { get; set; }

    [Column]
    public Int32 Number { get; set; }

    [Column]
    public string Name { get; set; }
   
}&lt;/pre&gt;

&lt;p&gt;Lets take a look at the above class because there are a few things I would like to point out&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;[&lt;a href="http://msdn.microsoft.com/en-us/library/bb534395.aspx"&gt;Table&lt;/a&gt;] Attribute – Designates a class as an entity class that is associated with a database table. &lt;/li&gt;

  &lt;li&gt;[&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.aspx"&gt;Column&lt;/a&gt;] Attribute - Associates a class with a column in a database table. 

    &lt;ol&gt;
      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.isprimarykey.aspx"&gt;IsPrimaryKey&lt;/a&gt; Property - Represents a column that is part or all of the primary key of the table. &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.isdbgenerated.aspx"&gt;IsDbGenerated&lt;/a&gt; Property – Represents whether a column contains values that the database auto-generates – I have this turned off in my example because my data is pushed from a backend server w/ the ID created &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.dbtype.aspx"&gt;DbType&lt;/a&gt; Property – Represents type of the database column, this is optional as the type can be inferred as well &lt;/li&gt;

      &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.columnattribute.canbenull.aspx"&gt;CanBeNull&lt;/a&gt; Property – Represents whether a column can contain null values. &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see this is pretty straight forward and pretty easy to setup.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;&lt;strong&gt;Step 4: Creating and Using the DataContext to init your database&lt;/strong&gt;&lt;/pre&gt;

&lt;pre class="c-sharp" name="code"&gt;var dimecastsDataContext = new DimecastsDataContext();

if (!dimecastsDataContext.DatabaseExists())
{
    dimecastsDataContext.CreateDatabase();    
}&lt;/pre&gt;

&lt;p&gt;The code above will create an instance of our DataContext.&amp;#160; When we have this DataContext we can create the database (after making sure it does not already exist) by calling the .CreateDatabase().&amp;#160; Scan your code looking for classes w/ the [Table] marker and setup/create your db schema.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;&lt;strong&gt;Step 5: Creating and Querying you database&lt;/strong&gt;&lt;/pre&gt;

&lt;pre class="c-sharp" name="code"&gt;var episode1 = new Episode
                    {
                        Id = 1,
                        Number = 1,
                        Name = &amp;quot;Episode 1&amp;quot;
                    };

dimecastsDataContext.Episodes.InsertOnSubmit(episode1);

dimecastsDataContext.SubmitChanges();

var foiundEpisodes = (from e in dimecastsDataContext.Episodes
                select e).ToList();&lt;/pre&gt;

&lt;p&gt;In the code above we are doing a few things.&amp;#160; &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;We are creating the episode entity we want to add to the database&lt;/li&gt;

  &lt;li&gt;We are adding the newly created entity to the table (.Episodes is our table pointer remember)&lt;/li&gt;

  &lt;li&gt;We are calling .SubmitChanges() on our DataContext in order to save our changes&lt;/li&gt;

  &lt;li&gt;We are running a Linq query to get the newly entered data out of our database.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using Sql Ce is pretty easy, but this is ‘the simple’ case, but it is also a great jumping point to learning how to use the database.&amp;#160; In a future posts we will take a look at more in-depth features/usages of Sql CE on WP7.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68015" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/SQL+CE+3.5/default.aspx">SQL CE 3.5</category></item><item><title>NotSupportedException w/ Sql CE on WP7 Mango</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/20/notsupportedexception-w-sql-ce-on-wp7-mango.aspx</link><pubDate>Wed, 20 Jul 2011 23:40:47 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68013</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68013</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68013</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/20/notsupportedexception-w-sql-ce-on-wp7-mango.aspx#comments</comments><description>&lt;p&gt;As I am learning how to use SQL Ce which is available inside of WP7 mango I came across the following exception.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_072A9300.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_3196C41D.png" width="456" height="256" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This exception came from the following Linq statement&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;         
var episodesWithTags = ( from e in dimecastsDataContext.Episodes
	where e.EpisodeTags.Count( x =&amp;gt; x.TagName == &amp;quot;Something 3&amp;quot;) &amp;gt; 0
        select e ).ToList();&lt;/pre&gt;

&lt;p&gt;The above statement is straight forward enough and of course the TagName property is part of EpisodeTag so I was thrown for a loop.&amp;#160; As I am still learning this I bounced over to the EpsideTag definition you see below:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt; 
    [Table]
    public class EpisodeTag
    {
     
	... Fluff goes here
        
        public string TagName { get; set; }
    }&lt;/pre&gt;

&lt;p&gt;As you can see the TagName property is there, but it is missing one little thing, the [Column] attribute. As soon as I added the missing attribute as you see below everything worked just fine.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt; 
    [Table]
    public class EpisodeTag
    {
     
	... Fluff goes here

     	[Column]   
        public string TagName { get; set; }
    }&lt;/pre&gt;

&lt;p&gt;So if you ever run into this error, and you will make double, triple sure that you have added the [Column] attribute to the property in question.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68013" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/SQL+CE+3.5/default.aspx">SQL CE 3.5</category></item><item><title>Using the  Isolated Storage Explorer tool on WP7 Mango to export your .sdf file</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/19/using-the-isolated-storage-explorer-tool-on-wp7-mango-to-export-your-sdf-file.aspx</link><pubDate>Tue, 19 Jul 2011 11:13:54 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68004</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68004</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68004</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/19/using-the-isolated-storage-explorer-tool-on-wp7-mango-to-export-your-sdf-file.aspx#comments</comments><description>&lt;p&gt;One of the biggest complaints (from myself and others) about V1 of WP7 was the total and complete lack of a built in database (although v1 of WP7 did have SQL CE on the device but developers did not have access to use it).&amp;#160; When I say there was no built in database don’t misread that to say there is no data storage support cause there is but it is in the form of blob storage inside of the Isolated storage area.&amp;#160; This type of storage worked and some great libraries were built on top of this storage to give your app SQL like&amp;#160; abilities, but non of them gave you a true SQL experience.&lt;/p&gt;  &lt;p&gt;With the upcoming release (this post is based of the Beta build of Mango) of WP7 Mango developers now have full access to SQL CE inside your application.&amp;#160; This means that you can do many cool things.&amp;#160; One of the really cool things that can be done w/ this SQL access is the ability to import/export your .sdf (SQL CE database file) file in order to view the data inside of SQL Management studio or Visual Studio.&lt;/p&gt;  &lt;p&gt;In this post I will walk you though what is needed in order to use the &lt;a href="http://msdn.microsoft.com/en-us/library/hh286408%28v=VS.92%29.aspx"&gt;Isolated Storage Explorer&lt;/a&gt; tool and how to use this tool to export your .sdf file to your hard drive.&amp;#160; I will than walk you through how to connect to that .sdf file via Visual Studio in order to run queries against the data.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1: Running the Isolated Storage tool&lt;/strong&gt;    &lt;br /&gt;This tool is NOT a GUI based tool but rather a command line tool, but it is not hard to use or to learn.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open up a command prompt and navigate to c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool &lt;/li&gt;    &lt;li&gt;In order to extract your data file you will want to run the following command:&amp;#160; &lt;br /&gt;&lt;em&gt;ISETool.exe ts xd GUIDGOESHERE PATHTOEXPORTGOESHERE&lt;/em&gt;       &lt;br /&gt;Let me break down this command in a little more details       &lt;ul&gt;       &lt;li&gt;&lt;strong&gt;ISETool.exe&lt;/strong&gt; is the commandline too to work with Isolated Storage &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;ts&lt;/strong&gt; is the command to instruct the take a snapshot of the Isolated Storage data &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;xd&lt;/strong&gt; is the command to instruct the app to look at a running emulator (use de if you want to hit a real device) &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;GUIDGOESHERE&lt;/strong&gt; is the Application GUID for your WP7 application which can be found in your WMAppManifest.xml file           &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_64CE2ABF.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_124F4A83.png" width="417" height="43" /&gt;&lt;/a&gt;           &lt;br /&gt;&lt;/li&gt;        &lt;li&gt;&lt;strong&gt;PATHTOEXPORTGOESHERE&lt;/strong&gt; is the full path to a folder on your hard drive to store the exported .sdf file           &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1D0CA1D8.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_1CA06EE3.png" width="644" height="189" /&gt;&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Attach the .sdf file to a running instance of Visual Studio&lt;/strong&gt;    &lt;br /&gt;You will want to open up Visual Studio and open the Server Explorer window/pane.&amp;#160; Once you have this window open you will need to connect to your .sdf file as such:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Click the Connect to Database button in the Server Explorer     &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_5B91EF7E.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_292E1BFF.png" width="244" height="81" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;When you click the connect button you will need to add a connection.&amp;#160; When the dialog below opens the default should be SQL Client.&amp;#160; Make sure you click the change button and select SQL CE 3.5.&amp;#160; Selecting SQL CE will change the dialog and you should populate it as you see below.&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1A83701A.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_20CA46A8.png" width="182" height="244" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Step 3: Open the database and take a look at the schema&lt;/strong&gt;    &lt;br /&gt;One you have attached your .sdf file you should now see the database attached to the Server Explorer.&amp;#160; You should be able to see all the table schema information as below    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_27111D36.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_5FBBC743.png" width="244" height="208" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 4: Query the data&lt;/strong&gt;    &lt;br /&gt;Now that you have attached the database and you can see the schema the next logical thing to do is query the data.&amp;#160; You can do this one of two ways.&amp;#160; You can either right click on the table and choose ‘Show Table Data’ or you can create a new query and write custom sql.&amp;#160; Below is the output of choosing to show table data.    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_583057D6.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_25CC8457.png" width="348" height="169" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see using when using SQL CE on WP7 Mango it is very easy to export your .sdf file and view the contents of the file inside of Visual Studio.&amp;#160; Having this ability is very powerful because it can give the developers the ability to run analysis on their data or inspect their data at any time to ensure they are heading down the right path.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68004" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>Using Ninject (with CommonServiceLocator) with Caliburn.Micro on WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/08/using-ninject-with-commonservicelocator-with-caliburn-micro-on-wp7.aspx</link><pubDate>Fri, 08 Jul 2011 09:35:54 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:67954</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=67954</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=67954</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/08/using-ninject-with-commonservicelocator-with-caliburn-micro-on-wp7.aspx#comments</comments><description>&lt;p&gt;As I am in the process of rebuilding my Dimecasts.net WP7 application from the ground up to work with WP7 Mango one of the things I wanted to do was fully use the &lt;a href="http://caliburnmicro.codeplex.com/"&gt;Caliburn.Micro&lt;/a&gt; framework.&amp;nbsp; Caliburn.Micro has its own built in &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;IoC&lt;/a&gt; container called the &lt;a href="http://caliburnmicro.codeplex.com/SourceControl/changeset/view/47de308d08ed#src%2fCaliburn.Micro.WP7.Extensions%2fPhoneContainer.cs"&gt;PhoneContainer&lt;/a&gt; which provides basic &lt;a href="http://en.wikipedia.org/wiki/Dependency_Injection"&gt;Dependency Injection&lt;/a&gt; and this container works great but I have a bit of history using Ninject with my Wp7 applications so I wanted to replace the usage of the PhoneContainer with my &lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt;, or more precisely the &lt;a href="http://commonservicelocator.codeplex.com/"&gt;CommonServiceLocator&lt;/a&gt; implementation of Ninject.&amp;nbsp; I knew this had to be doable because there are examples of using &lt;a href="http://mef.codeplex.com/"&gt;MEF&lt;/a&gt; with Caliburn.Micro&lt;/p&gt; &lt;p&gt;Turns out I was right using Ninject w/ the CommonServiceLocator inside of Caliburn.Micro is doable and is very easy to boot.&amp;nbsp; Of course before I set out to build my own implementation of this I decided to google for it and this &lt;a href="http://caliburnmicro.codeplex.com/discussions/230861"&gt;post&lt;/a&gt; was about the closest I could find to working code, but this code was NOT complete, at least for the current CM implementation.&amp;nbsp; Even though the post I found was not complete working code it was a great headstart in what needed to be done.&lt;/p&gt; &lt;p&gt;Here is how I got Caliburn.Micro to use Ninject as its IoC container.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Step 1: Register the setup bootstrapper that you want to use&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;You will need to open up your App.xaml file and put in the code below.&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;    &amp;lt;!--Application Resources--&amp;gt;
    &amp;lt;Application.Resources&amp;gt;
    	&amp;lt;local:NinjectBootstrapper x:Key=&amp;quot;bootstrapper&amp;quot; /&amp;gt;
    &amp;lt;/Application.Resources&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Create the a NinjectBootstrapper which inherits off of &lt;/strong&gt;&lt;a href="http://caliburnmicro.codeplex.com/SourceControl/changeset/view/47de308d08ed#src%2fCaliburn.Micro.WP7%2fPhoneBootstrapper.cs"&gt;&lt;strong&gt;PhoneBootstrapper&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Caliburn.Micor uses its bootstrapper to do some basic setup and configuration work.&amp;nbsp; It is here that we want to extend this and add support for Ninject and the CommonServiceLocator.&amp;nbsp; Go ahead and create a class as you see below.&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public class NinjectBootstrapper : PhoneBootstrapper
{
    private NinjectContainer _ninjectContainer;

    protected override void Configure()
    {
        _ninjectContainer = new NinjectContainer(RootFrame);

        _ninjectContainer.RegisterDefaultBindings( typeof ( DashboardViewModel ), typeof ( IEventAggregator ) );
        _ninjectContainer.RegisterPhoneServices();

        var ninjectServiceLocator = new NinjectServiceLocator(_ninjectContainer.Kernel);

        ServiceLocator.SetLocatorProvider(() =&amp;gt; ninjectServiceLocator);     
    }

    protected override object GetInstance(Type service, string key)
    {
        if (service != null)
        {
            return ServiceLocator.Current.GetInstance( service, key );
        }

        throw new ArgumentNullException(&amp;quot;service&amp;quot;);
    }

    protected override IEnumerable&amp;lt;object&amp;gt; GetAllInstances(Type service)
    {
        return ServiceLocator.Current.GetAllInstances( service );
    }

    protected override void BuildUp(object instance)
    {
        _ninjectContainer.Kernel.Inject(instance);
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Implement the Ninject Setup logic&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As you can see from step 2 I have created a class which actually performs all the direct Ninject setup and I called it the NinjectContainer.&amp;nbsp; Below is the code for this container.&amp;nbsp; You should also note 2 more things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;This container implements &lt;a href="http://Caliburn%20Micro:%20WPF,%20Silverlight%20and%20WP7%20made%20easy."&gt;IPhoneContainer&lt;/a&gt; from Caliburn.Micro 
&lt;li&gt;In the RegisterPhoneServices method this is a very manual rebinding of Caliburn.Micro and it is likely that I missed something.&amp;nbsp; This code was a direct port from the default implementation of the Caliburn IoC container setup. &lt;/li&gt;&lt;/ol&gt;&lt;pre class="c-sharp" name="code"&gt;public class NinjectContainer : IPhoneContainer
{
    private readonly IKernel _kernel;
    private readonly Frame _rootFrame;

    public NinjectContainer( Frame rootFrame )
    {
        _kernel = new StandardKernel();
        _rootFrame = rootFrame;
    }

    public event Action&amp;lt;object&amp;gt; Activated;

    public IKernel Kernel
    {
        get { return _kernel; }
    }

    public void RegisterWithPhoneService( Type service, string phoneStateKey, Type implementation )
    {}

    public void RegisterWithAppSettings( Type service, string appSettingsKey, Type implementation )
    {}

    public void RegisterPhoneServices(bool treatViewAsLoaded = false)
    {
        var phoneService = new PhoneApplicationServiceAdapter(_rootFrame);
        var navigationService = new FrameAdapter(_rootFrame, treatViewAsLoaded);
            
        Kernel.Rebind&amp;lt;IPhoneContainer&amp;gt;().ToMethod(x =&amp;gt; this);
        Kernel.Rebind&amp;lt;INavigationService&amp;gt;().ToMethod(x =&amp;gt; navigationService);
        Kernel.Rebind&amp;lt;IPhoneService&amp;gt;().ToMethod(x =&amp;gt; phoneService);
        Kernel.Rebind&amp;lt;IEventAggregatorv().To&amp;lt;EventAggregator&amp;gt;().InSingletonScope();
        Kernel.Rebind&amp;lt;IWindowManager&amp;gt;().To&amp;lt;WindowManager&amp;gt;().InSingletonScope();
        Kernel.Rebind&amp;lt;IVibrateController&amp;gt;().To&amp;lt;SystemVibrateController&amp;gt;().InSingletonScope();
        Kernel.Rebind&amp;lt;ISoundEffectPlayer&amp;gt;().To&amp;lt;XnaSoundEffectPlayer&amp;gt;().InSingletonScope();
        Kernel.Rebind&amp;lt;StorageCoordinator&amp;gt;().To&amp;lt;StorageCoordinator&amp;gt;().InSingletonScope();
        Kernel.Rebind&amp;lt;TaskController&amp;gt;().To&amp;lt;TaskController&amp;gt;().InSingletonScope();
            

        var coordinator = Kernel.Get&amp;lt;StorageCoordinator&amp;gt;();
        coordinator.Start();

        var taskController = Kernel.Get&amp;lt;TaskController&amp;gt;();
        taskController.Start();
    }

    public void RegisterDefaultBindings( params Type[] typesToScanAssembliesFor )
    {
        // scan services
        Kernel.Scan(x =&amp;gt;
        {
            foreach ( var type in typesToScanAssembliesFor )
            {
                x.FromAssemblyContaining( type );
            }
                
            x.Where(type =&amp;gt; type.Name.EndsWith(&amp;quot;Service&amp;quot;));

            x.BindWithDefaultConventions();

            x.InSingletonScope();
        });

        // scan the rest
        Kernel.Scan(x =&amp;gt;
        {
            foreach (var type in typesToScanAssembliesFor)
            {
                x.FromAssemblyContaining(type);
            }

            x.Where(type =&amp;gt; !type.Name.EndsWith(&amp;quot;Service&amp;quot;));

            x.BindWithDefaultConventions();
        });
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 4: Hit F5 and see the fruits of your effort&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now if we did everything right your application should not be able to be run and Caliburn.Micro and Ninject (and CSL) as its IoC container.&lt;/p&gt;
&lt;p&gt;As you can see you can swap out the built in IoC container w/ Ninject inside of Caliburn.Micro with almost no effort.&amp;nbsp; I hope this helps and others enjoy.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;/object&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=67954" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Caliburn+Micro/default.aspx">Caliburn Micro</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>XamlParseException from WP7 Mango and Caliburn.Micro</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/03/xamlparseexception-from-wp7-mango-and-caliburn-micro.aspx</link><pubDate>Sun, 03 Jul 2011 22:41:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:67941</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=67941</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=67941</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/07/03/xamlparseexception-from-wp7-mango-and-caliburn-micro.aspx#comments</comments><description>&lt;p&gt;*** UPDATE: Turns out the is expected as Caliburn will create its own instance of the PhoneApplicationService for you.&amp;#160; Also when using Caliburn.Micro make sure that your App.xaml.cs is empty as Caliburn.Micro has better facilities for handling all these actions. ***&lt;/p&gt;  &lt;p&gt;Today when I was kicking off a new Wp7 Mango project where I was going to use &lt;a href="http://caliburnmicro.codeplex.com/"&gt;Caliburn.Micro&lt;/a&gt; soup to nuts I quickly ran into the following exception.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_051F5B05.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2B813E50.png" width="456" height="271" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now before I explain what is needed to resolve this error (I hope) let me quickly explain what I had done so far in my project which lead up to this.&amp;#160; I did the following:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Created a new WP7 Mango Application (not pivot, not panorama) &lt;/li&gt;    &lt;li&gt;Downloaded the latest nightly build of Calibrun.Micro &lt;/li&gt;    &lt;li&gt;Opened one of the Caliburn.Micro sample applications and copied it’s WP7AppBootstraper &lt;/li&gt;    &lt;li&gt;Hit F5 &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;When I ran the application, which had NOTHING in it other than the default setup contents I received the error above.&amp;#160; Since I had not setup the ability to walk though the Caliburn.Micro source (something I have since done) I quickly took another quick scan of the sample WP7 Navigation sample that is part of the Caliburn.Micro source tree to see what I had done differently.&amp;#160; &lt;/p&gt;  &lt;p&gt;After about 2 minutes of looking I noticed that my App.xaml was a bit different.&amp;#160; I had the following in my App.xaml    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_38E75156.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_387B1E61.png" width="663" height="135" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Just for giggles I commented out the line which setup the PhoneApplicationService (as you see below):    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_0A2198B4.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_09B565BF.png" width="701" height="127" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After commenting out the line above I again hit F5.&amp;#160; This time my error went away and the application loaded as expected.&amp;#160; Now I am not sure of 2 things.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Is this a Mango only issue w/ Caliburn.Micro (assuming it is an issue at ALL w/ CM) &lt;/li&gt;    &lt;li&gt;Is this something that should ALWAYS be removed when building a Caliburn.Micro application? &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;No matter the reason or the cause it did appear to solve my issue.&amp;#160; So if you are having the same issue try removing the code above from your app.xaml and see if that helps.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=67941" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Caliburn+Micro/default.aspx">Caliburn Micro</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>Don’t Kid Yourself, Size Does Matter…Least when talking about Web Service Messages</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/17/don-t-kid-yourself-size-does-matter-least-when-talking-about-web-service-messages.aspx</link><pubDate>Tue, 17 May 2011 06:57:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:67304</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=67304</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=67304</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/17/don-t-kid-yourself-size-does-matter-least-when-talking-about-web-service-messages.aspx#comments</comments><description>&lt;p&gt;Ok, now that I have your attention, it is time to get your mind out of the gutter and back on the topic at hand.&amp;nbsp; When you are building out native mobile applications you are undoubtedly going to communicate to some sort of back end server via some sort of Web Service (say WCF for example if building on top of the Windows Phone 7 platform).&lt;/p&gt;
&lt;p&gt;When build these web service endpoints most developers will pay attention to the type and the amount of data which is being sent across the wire, but I would venture a guess that for the most part they are doing this for the wrong, yet still very valid, reason.&amp;nbsp;&amp;nbsp; I know in the past when I have build out endpoints and the payloads they were going to be communicating I was solely focused on making sure that only the minimum data points which are needed by the consumer are being sent.&amp;nbsp; As valid as this is, you should also concern yourself with the actual payload size in kilobytes which is being sent.&amp;nbsp; Which in my opinion is the right reason to pay attention to the data being sent across the wire.&lt;/p&gt;
&lt;p&gt;Why should you focus on the size of the message more so than the content of the message?&amp;nbsp; Well by focusing on the size you will be indirectly focusing on the content as well but you will be doing so from a different perspective.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Things you can do to reduce the payload size?&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/a&gt; rather than xml based web services:
    &lt;br /&gt;
    &lt;br /&gt;In my experience if you can encode (format) your payload as JSON you will see a size reduction of 40% or MORE in your payload.&amp;nbsp; And when we are talking about sending data across the wire (aka the cell network) this can and will have a huge impact on your applications performance.
    &lt;/li&gt;
&lt;li&gt;If you use XML, make sure you use concise property names:
    &lt;br /&gt;
    &lt;br /&gt;When you build out your object model try to use concise rather than verbose names for properties.&amp;nbsp; For example if you have an object called Customer there is no need to name a property CustomerFirstName but rather I would suggest you call it First.&amp;nbsp; First the &amp;lsquo;Customer&amp;rsquo; prefix should be inferred from the object context and the suffix of name should also be inferred.&amp;nbsp; By removing Customer and Name you are actually saving 24 characters, not 12.&amp;nbsp; Remember w/ XML you have the closing tag so the serialized message will be &amp;lt;First&amp;gt;Something&amp;lt;/First&amp;gt; rather than &amp;lt;CustomerFirstName&amp;gt;Something&amp;lt;/CustomerFirstName&amp;gt;.
    &lt;br /&gt;
    &lt;br /&gt;If you pay attention to this convention you could see as much as a 20-25% reduction in your message.&amp;nbsp; But word to the wise, I would still prefer readability over a super reduction in size.&amp;nbsp; There are a few blog posts out there that would suggest you name the property something like &amp;lsquo;F&amp;rsquo;.&amp;nbsp; Personally I think this obfuscates the intent of the message too much and this trumps a smaller message, but each scenario is unique and maybe you need that level of reduction in size.
    &lt;/li&gt;
&lt;li&gt;If you use XML, make sure you control your namespaces of your objects:
    &lt;br /&gt;
    &lt;br /&gt;When you use WCF and DataContracts you have the ability to specify the namespace for each object.&amp;nbsp; In my experience the default namespace which is provided (the one of your physical object model) often times is very long.&amp;nbsp; In WCF you have the ability to specify a shorter namespace which can be used.&amp;nbsp; And when I specify this namespace I take the time to create it as a valid Uri rather than a object model namespace.&amp;nbsp; I have seen a 3-5% reduction in message size by doing this.&amp;nbsp; I know you are thinking that 3-5% is not much, but remember when talking about pushing data over networks such as Cell networks that can have a bit of an impact.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you pay attention to your message from the size perspective and monitor this information you will be surprised by what type of performance gains you can receive.&amp;nbsp; This type of performance tuning is about the simplest and easiest you can perform and the ROI on it can be substantial.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=67304" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category></item><item><title>Missing Method Exception w/ Caliburn.Micro when using INavigationService</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/09/missing-method-exception-w-caliburn-micro-when-using-inavigationservice.aspx</link><pubDate>Mon, 09 May 2011 12:40:07 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:67263</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=67263</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=67263</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/09/missing-method-exception-w-caliburn-micro-when-using-inavigationservice.aspx#comments</comments><description>&lt;p&gt;As I continue to build out a WP7 application using Caliburn Micro I ran into a odd error.&amp;#160; When trying to inject the INavigationService I would get a ‘Missing Method’ exception as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_6BE9F76C.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_09E80561.png" width="644" height="230" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When I first started to look at the error it did not make any sense.&amp;#160; Everything appeared to be in order, but of course there had to be something wrong.&amp;#160; lets take a look at what was wrong and how to resolve it.&lt;/p&gt;  &lt;p&gt;When building out a WP7 app using Caliburn.Micro when you let the Visual Studio template the template will create a ‘framework’ folder for you.&amp;#160; This framework folder has some killer code in it, but be careful because much of what is generated here also lives in the Caliburn.Micro namespace (in fact all this code may be duplicated, but I am too new to the framework to know for 100%).&lt;/p&gt;  &lt;p&gt;The first thing I did when setting up my application is to add the following method to my PhoneContainer.cs class (this is based on a few example projects I have seen)&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public void RegisterPhoneServices( bool treatViewAsLoaded = false )
{
    RegisterInstance( typeof( Caliburn.Micro.INavigationService ), null, new FrameAdapter( _bootstrapper.RootFrame, treatViewAsLoaded ) );
    RegisterInstance( typeof( Caliburn.Micro.IPhoneService ), null, new PhoneApplicationServiceAdapter( _bootstrapper.PhoneService ) );
    RegisterSingleton( typeof( IWindowManager ), null, typeof( WindowManager ) );
    RegisterSingleton( typeof( IEventAggregator ), null, typeof( EventAggregator ) );
}&lt;/pre&gt;

&lt;p&gt;The intent of the code above is to setup the IoC container with many of the default services I want to use from the framework.&amp;#160; You will notice that in the first two I have prefixed the interfaces with Caliburn.Micro (which we my undoing as I will learn).&amp;#160; The reason for this is that my project spans multiple dll’s and this was how I could get it to compile.&lt;/p&gt;

&lt;p&gt;When I would try to run this code:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;var instance1 = container.GetInstance( typeof( DashboardViewModel ), &amp;quot;DashboardViewModel&amp;quot; );&lt;/pre&gt;

&lt;p&gt;This when I would get the missing method exception from above.&amp;#160; After about 10 minutes of looking at this code and trying a few different things I knew for a FACT that the error was due to the usage of the INavigationService interface, now just to understand what the root cause was.&lt;/p&gt;

&lt;p&gt;As I went back to the location where I register the interface it downed on me.&amp;#160; What is the namespace of the ‘FrameAdapter’ object?&amp;#160; Of course it was NOT Caliburn.Micro…hum could this be the cause.&amp;#160; Turns out it was.&amp;#160; When I prefixed FrameAdapter to look like below&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;RegisterInstance( typeof( Caliburn.Micro.INavigationService ), null, new Caliburn.Micro.FrameAdapter( _bootstrapper.RootFrame, treatViewAsLoaded ) );&lt;/pre&gt;

&lt;p&gt;Everything now worked as expected.&amp;#160; The moral of the story is this.&amp;#160; If you are going to use this awesomeness which is Caliburn.Micro either use the libraries from the Caliburn.Micro.dll or DON’T.&amp;#160; Do NOT mix apples and oranges.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;

&lt;p&gt;P.S. I am sure I am really doing something wrong in general w/ Caliburn.Micro but hey that is how you learn right &lt;img style="border-bottom-style:none;border-right-style:none;border-top-style:none;border-left-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/wlEmoticon_2D00_smile_5F00_7AF0B079.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=67263" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category></item><item><title>Update Error 800705B4 for WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/19/update-error-800705b4-for-wp7.aspx</link><pubDate>Tue, 19 Apr 2011 20:20:15 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:66968</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=66968</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=66968</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/19/update-error-800705b4-for-wp7.aspx#comments</comments><description>&lt;p&gt;So today was the first day I was able to get the NoDo update for my Samsung Focus so of course I wanted to update my phone ASAP, but…..&lt;/p&gt;  &lt;p&gt;When I ran the update I received the following error:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_30AEB9FD.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_35B0F7AC.png" width="496" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When I googled for this error (along w/ bitch about it on twitter) I found the following link &lt;a title="http://support.microsoft.com/kb/2484484#800705B4" href="http://support.microsoft.com/kb/2484484#800705B4"&gt;http://support.microsoft.com/kb/2484484#800705B4&lt;/a&gt; .&lt;/p&gt;  &lt;p&gt;I tried step 1 which is remove all the history but that did not work&lt;/p&gt;  &lt;p&gt;I tried step 2 which was to remove some apps, I removed like 20 apps, but that did not work&lt;/p&gt;  &lt;p&gt;I then tried step 2 again but this time I removed ALL developer built apps off the phone (this phone is developer unlocked)…this &lt;font color="#ff0000" size="4"&gt;WORKED&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;If you find our self having issues and are getting this error AND your phone is developer unlocked try removing ALL developer builds from the phone.&amp;#160; This solved my problem.&lt;/p&gt;  &lt;p&gt;Now back to work.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=66968" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category></item><item><title>Using Binding to create Panels/Pivots in your WP7 Application</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/19/using-binding-to-create-panels-pivots-in-your-wp7-application.aspx</link><pubDate>Tue, 19 Apr 2011 10:19:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:66962</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=66962</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=66962</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/19/using-binding-to-create-panels-pivots-in-your-wp7-application.aspx#comments</comments><description>&lt;p&gt;If you are building a Windows Phone 7 application it is very likely that you are going to incorporate either the Panoramic or Pivot layouts in your app.&amp;nbsp; In most cases when you are building these your panels/pivots are fairly static.&amp;nbsp; However, what do you do when the number of panels/pivots needs to changed based on environmental setting (ie data or user preferences)?&lt;/p&gt;
&lt;p&gt;One solution is to use the code behind and manually create your panels/pivots.&amp;nbsp; However, I personally feel this method is clunky and fugly.&amp;nbsp; I would rather stay as close to the MvvM pattern as possible as well as harness the power of Binding to build my UI on the fly based on values inside my view model.&amp;nbsp; In this post we are going to take a look at how simple it is to bind your View Model to your UI and have your panels/pivots built for you.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Create the View Model&amp;rsquo;s to Bind to the UI&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Main View Model &amp;ndash; This is the one bound directly to the UI&lt;/i&gt;&lt;/p&gt;
&lt;pre class="c-sharp" name="code"&gt;    public class DashboardViewModel : ViewModelBase
    {
        // This is an internal class and does not change the implementation...
        private readonly IDashboardService _dashboardService;

        public DashboardViewModel( IDashboardService dashboardService )
        {
            _dashboardService = dashboardService;
        }


        public string Title 
        {
            get { return _dashboardService.DashboardTitle; } 
            set 
            { 
                _dashboardService.DashboardTitle = value;
                RaisePropertyChangedEventImmediately( &amp;quot;Title&amp;quot; );
            }
        }

        public ObservableCollection PanelCollection
        {
            get { return _dashboardService.PanelItems; }
            set
            {
                _dashboardService.PanelItems = value;
                RaisePropertyChangedEventImmediately( &amp;quot;PanelCollection&amp;quot; );
            }
        }
    }&lt;/pre&gt;
&lt;p&gt;In the class above there are 2 properties we need to know about.&amp;nbsp; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Title &amp;ndash; This is the property in the VM which will create the actual title for the entire Panorama control &lt;/li&gt;
&lt;li&gt;PanelCollection &amp;ndash; This is the property in the VM which contains the list of items which will be used to generate each panel/pivot in the UI &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;i&gt;Panel View Model &amp;ndash; These are the ones which will build each panel/pivot&lt;/i&gt;&lt;/p&gt;
&lt;pre class="c-sharp" name="code"&gt;    public interface IDashboardPanelItemViewModel
    {
        DashboardPanelType DashboardPanelType { get; set; }

        string DashboardTitle { get; set; }

        ObservableCollection&amp;lt;IDashboardPanelListItemViewModel&amp;gt;: PanelListItems { get; set; }
    }&lt;/pre&gt;
&lt;p&gt;In the class (actually it is an interface) above there are 3 properties we need to worry about&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;DashboardPanelType &amp;ndash; This really does not change how the panels are bound to the UI but rather is used to determine how the actual panel data is displayed (future post on this) &lt;/li&gt;
&lt;li&gt;DashboardTitle &amp;ndash; This is the property which will create the text title for the panel/pivot &lt;/li&gt;
&lt;li&gt;PanelListItems &amp;ndash; This is the property which will contain the individual data points which will be displayed on the created panel/pivot&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Create the xaml to hookup the binding&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;When binding the Main View Model (the first class above) to the UI we need to do 2 things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Need to bind our main View Model to the Panorama (or PIvot)
    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_3890E917.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="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2C8EF8E3.png" border="0" height="26" width="644" /&gt;&lt;/a&gt;
    &lt;/li&gt;
&lt;li&gt;Need to bind the individual list item from the element in PanelCollection to the panel
    &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_7E357335.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="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_04E87CB9.png" border="0" height="64" width="644" /&gt;&lt;/a&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When looking at the 2 snippets above you want to pay attention to the ItemsSource Property in both.&lt;/p&gt;
&lt;p&gt;The End Result (bit fugly, but this is for demo only)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1D781A09.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="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_3607B759.png" border="0" height="459" width="254" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you can using Binding to create your panels/pivots based on the data in your view model is super simple and requires NO code behind code to accomplish.&amp;nbsp; Please be aware though that you should NOT generate too many panels/pivots as that is a massive UI design smell.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=66962" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Null Reference from Simple Container in Caliburn Micro</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/10/null-reference-from-simple-container-in-caliburn-micro.aspx</link><pubDate>Sun, 10 Apr 2011 12:59:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:66858</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=66858</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=66858</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/04/10/null-reference-from-simple-container-in-caliburn-micro.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:small;"&gt;I am building out a new Windows Phone 7 application and this time I am finally going to use the &lt;/span&gt;&lt;a href="http://caliburnmicro.codeplex.com/"&gt;&lt;span style="font-size:small;"&gt;Caliburn Micro&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt; framework (I have been telling Rob I was going to for a long, long time).&amp;nbsp; Of course one of the great features of this framework is that it was built from the beginning to support DI (&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Dependency_injection"&gt;&lt;span style="font-size:small;"&gt;Dependency Injection&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;) with its own built in, light DI container.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;When setting up the container you have the ability to provide keys for the items which you register.&amp;nbsp; However, one thing I was not aware of (it may be documented someplace) is that not all items in the container can/should have keys.&amp;nbsp; I have a ViewModel which I have registered using the standard way (seen below)&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;container.RegisterPerRequest( typeof( DashboardViewModel ), &amp;quot;DashboardViewModel&amp;quot;, typeof( DashboardViewModel ) );
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;and this View Model needed a dependency injected into it (an IDashboardService).&amp;nbsp; In order to inject this IDashboardService I created the line below:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;container.RegisterPerRequest( typeof( IDashboardService ), &amp;quot;MlbDashboardService&amp;quot;, typeof( MlbDashboardService ) );&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;However when I ran the application I received a NullReferenceException inside SimpleContainer.ActivateInstace.&amp;nbsp; At first I thought I did not have the interface/concretes setup correctly inside the container but after a bit of double checking I was able to verify I did.&amp;nbsp; After a bit of debugging and walking though the code (not to mention pulling out more of my hair, which by the way I need to keep) I realized that the cause was that I have my IDashboardService a key. After realizing this I changed my registration line to be&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;container.RegisterPerRequest( typeof( IDashboardService ), null, typeof( MlbDashboardService ) );&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;Once I made this change and re-ran my application I was able to have my ViewModel created correctly and have the IDashboardService injected as expected.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;Now I do not know if this behavior is by intent or what but since I racked my brains trying to figure out what was causing the issues I figured I would share my thoughts just in case others where having the same issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;Till next time,&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=66858" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Caliburn+Micro/default.aspx">Caliburn Micro</category></item><item><title>Adding Runtime Intelligence to your Windows Phone 7 Application</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/03/31/adding-runtime-intelligence-to-your-windows-phone-7-application.aspx</link><pubDate>Thu, 31 Mar 2011 11:07:51 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:66761</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=66761</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=66761</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/03/31/adding-runtime-intelligence-to-your-windows-phone-7-application.aspx#comments</comments><description>&lt;p&gt;When building any type of application which is going to be deployed to the masses it is always important to know and understand how your application is being used in order to make more informed decisions on how to maintain or extend your application.&amp;#160; When it comes to adding in runtime intelligence into your application the team over at PreEmptive (the same folks that make Dotfuscator) have a killer product that is dead easy to use and gives you great results.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Lets get started and take a look at how to add Runtime Intelligence into your application&lt;/p&gt;  &lt;p&gt;Step 0 - Getting up and running: &lt;/p&gt;  &lt;p&gt;In order to add this runtime intelligence into your application you will need to download the &lt;a href="http://preemptive.com/know-more/windows-phone-7"&gt;WP7 Edition&lt;/a&gt; of Dotfuscator and have it installed.&amp;#160; Once you have it installed you will want to create a new project.&amp;#160; After the new project is created the area in the app we are going to focus on is found on the Instrumentation Tab.&amp;#160; The screenshot below shows this tab in action.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_7DF64ECF.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_5D02DC28.png" width="644" height="424" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1: Adding the ApplicationAttribute&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;In order to identify your application to the RuntimeIntelligence portal you must provide your application an ApplicationAttribute.&amp;#160; This should be placed on your main runtime exe/dll (your UI project for WP7). Here is how we can do this.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Right click the main dll in the Instrumentation Screen as such:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_15AD8636.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_6A68EF2E.png" width="244" height="71" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Choose Add Attribute and then select the PreEmptive.Attributes.ApplicationAttribute and click ok      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_2E3D2386.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_1BF45CC4.png" width="244" height="160" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Provide the details of your application:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_22A76647.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4830E3A8.png" width="244" height="129" /&gt;&lt;/a&gt;       &lt;ol&gt;       &lt;li&gt;For Application Type you can put anything you want there, I just like putting the platform &lt;/li&gt;        &lt;li&gt;For Guid click the ellipse and it will grab the GUID off your selected dll to use &lt;/li&gt;        &lt;li&gt;For Name provide anything you want to identify your application &lt;/li&gt;        &lt;li&gt;For Version this can be anything, I started with 1.0.0.0 &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Adding the BusinessAttribute&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the step above we provided an attribute which identifies your application in the portal, this time we need to provide an attribute which identifies the app again, but this time from the perspective of your company and your license with PreEmptive.&amp;#160; Here is how we do this.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Right click the main dll in the Instrumentation Screen as such:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_07FACA2E.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_47C4B0B3.png" width="244" height="71" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Choose Add Attribute and then select the PreEmptive.Attributes.BusinessAttribute and click ok      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_006F5AC1.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_40394146.png" width="244" height="160" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Provide the details of your business:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_18FEF811.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_1FB20194.png" width="244" height="132" /&gt;&lt;/a&gt;       &lt;ol&gt;       &lt;li&gt;For CompanyKey provide the GUID which is provided to you from the &lt;a title="http://wp7.runtimeintelligence.com/" href="http://wp7.runtimeintelligence.com/"&gt;http://wp7.runtimeintelligence.com/&lt;/a&gt; portal (not that in this screenshot I did not provide the real key).&amp;#160; If you do not provide a valid key you will get the following runtime/compile error - Attribute validation error: The BusinessAttribute on assembly [Assembly name goes here] must have a valid company key. &lt;/li&gt;        &lt;li&gt;For CompanyName provide the name of the company          &lt;br /&gt;&lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Step 3: Adding the SetupAttribute&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once we have the Application and Business Attributes setup in order to ID your product we now must create a setup attribute.&amp;#160; This SetupAttribute is an instrumentation time attribute for methods. This attribute can be used to guide Application Analytics instrumentation.&amp;#160; This is REQUIRED and you will get an error if you do not have this setup.&amp;#160; Here is how we do this.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Find the entry point in your application.&amp;#160; For a WP7 application that will be in the App.xaml.cs file and you want to attach to the Application_Launching method.&amp;#160; Once you have found this method right click and and add an attribute as such:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_5F7BE819.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_71587BE6.png" width="244" height="69" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Choose Add Attribute and then select PreEmptive.Attributes.SetupAttribute and click ok:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_780B8569.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_65C2BEA7.png" width="244" height="160" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Provide the details:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_109B22BA.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_7E525BF7.png" width="364" height="260" /&gt;&lt;/a&gt;       &lt;ol&gt;       &lt;li&gt;For CustomEndpoint click the ellipse and choose the WP7 endpoint &lt;/li&gt;        &lt;li&gt;For ExtendedKeySourceOwner click the ellipse and find the entry point into your WP7 app. &lt;/li&gt;        &lt;li&gt;For InstanceIdSourceOwner click the ellipse and find the entry point into your WP7 app. &lt;/li&gt;        &lt;li&gt;Make sure the UseSSL is set to true &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 4: Adding the TeardownAttribute&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the same manor we needed to create a Setup Attribute we need to setup the TeardownAttribute.&amp;#160; The TeardownAttribute is an instrumentation time attribute for methods. This attribute can be used to guide Application Analytics instrumentation.&amp;#160; This will be used to tell the portal that your application has been closed.&amp;#160; This is REQUIRED and you will get an errorif you do not have this setup.&amp;#160; Here is how we do this.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Find the exit point in your application.&amp;#160; For a WP7 application this can be in the App.xaml.cs file and you want to attached to the Application_Closing method.&amp;#160; Once you have found this method right click and add an attribute as such:&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_7013E307.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_44CF4C00.png" width="244" height="55" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Choose Add Attribute and then select PreEmptive.Attributes.TeardownAttribute and click ok:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1D9502CB.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_765AB995.png" width="244" height="160" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Provide the details (well in this on you can leave all the defaults if you want)      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4F207060.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_23DBD959.png" width="364" height="106" /&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;Step 5: Adding a Feature Tracking Attribute&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ok, so we have done all the upfront busy work to enable us to get to this point.&amp;#160; The main point of adding intelligence is to do things like track feature usage or to enable performance tracking.&amp;#160; We will focus here on how to create feature tracking.&amp;#160; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Find an point/feature in your application which you want to track.&amp;#160; In our case we are going to track each time that a video is played so we are going to find the ‘HandlePlayEpisode’ method and right click this to add a new attribute as such:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4EB43D6B.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_0E7E23F1.png" width="244" height="50" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Choose Add Attribute and then select PreEmptive.Attributes.FeatureAttribute and click ok:      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_7C355D2E.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin: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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_54FB13F9.png" width="244" height="160" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Provide the details      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_74A9EDC1.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="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4D6FA48C.png" width="364" height="108" /&gt;&lt;/a&gt;       &lt;br /&gt;In this example we do not care about extended key values (these are custom data points which can be sent with your messages to give more context)       &lt;ol&gt;       &lt;li&gt;Set the FeatureEventType to Tick (which is the default) &lt;/li&gt;        &lt;li&gt;Provide a Name, this is required and should be unique.&amp;#160; I have a convention I follow in order to allow the names to be searchable and consistent.          &lt;br /&gt;&lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Step 6: Rebuild your .Xap with the analytics&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once you are done building your .xap you can then decompile the application via Reflector or what ever and take a look at the code which is injected via the PreEmptive process.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 7: Log into the WP7.Runtimeintelligence.com portal and see your information&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There you have, the 7 steps needed to go from 0 to runtime intelligence.&amp;#160; Adding this information is not difficult and can yield great information on how your application is being used in the field by REAL users.&amp;#160; &lt;/p&gt;  &lt;p&gt;Till next time,    &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=66761" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category></item></channel></rss>