<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Learning to Geek...</title>
        <link>http://geekswithblogs.net/gevjen/Default.aspx</link>
        <description>By George Evjen</description>
        <language>en-US</language>
        <copyright>George Evjen</copyright>
        <managingEditor>george.evjen@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Learning to Geek...</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/gevjen/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Entity is currently read-only</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/11/144317.aspx</link>
            <description>&lt;p&gt;&lt;font size="2" face="Lucida Sans"&gt;Quick post on an issue that we were having today. This fix may just be a band-aid for another issue but this fix at least got us moving again today. Since I didn’t see anything concrete online for a solution I figured I would post this as a part one fix and then post a more detailed fix later.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Lucida Sans"&gt;We were getting this error earlier today in one of our projects that uses EF and WCF Ria Services. &lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Lucida Sans"&gt;This entity is currently read-only. One of the following conditions exist: a custom method has been invoked, a submit operation is in progress, or edit operations are not supported for the entity type.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Lucida Sans"&gt;The work around that we used for this is to simply do a check to see if the property is read only. Each entity has that property on it. &lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font size="2" face="Lucida Sans"&gt;        private void SelectedInstitution_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (!_personDetailContext.CurrentPerson.IsReadOnly)&lt;br /&gt;            {&lt;br /&gt;                _personDetailContext.CurrentPerson.LastUpdatedDate = DateTime.Now;&lt;br /&gt;            }&lt;br /&gt;        }&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;pre&gt;&lt;font size="2" face="Lucida Sans"&gt;We check to see if the CurrentPerson in this situation is readonly. If its not read only we go ahead and execute some other code. &lt;/font&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;font size="2" face="Lucida Sans"&gt;Again, this got us moving today, I am sure this is just step one in resolving this issue. &lt;/font&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;font size="2" face="Lucida Sans"&gt;&lt;/font&gt;&lt;/pre&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144317.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/11/144317.aspx</guid>
            <pubDate>Fri, 11 Mar 2011 19:16:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144317.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/11/144317.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144317.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144317.aspx</trackback:ping>
        </item>
        <item>
            <title>Combobox binding with different types</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/10/144299.aspx</link>
            <description>&lt;p&gt;&lt;font size="3" face="Lucida Sans"&gt;Binding to comboboxes in Silverlight has been an adventure the past couple of days. In our framework at ArchitectNow we use LookupGroups and LookupValues. In our database we would have a LookupGroup of NBA Teams for example. The group would be called NBATeams, we get the LookupGroupID and then get the values from the LookupValues table. So we would end up with a list of all 30+ teams. Our lookup values entity has a display text(string), value(string), IsActive and some other fields. With our applications we load all this information into the system when the user is logging in or right after they login. So in cache we have a list of groups and values that we can get at whenever we want to. We get this information in our framework simply by creating an observable collection of type LookupValue. To get a list of these values into our property all we have to do is.&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#ff0000" size="3" face="Lucida Sans"&gt;var NBATeams = AppContext.Current.LookupSerivce.GetLookupValues(“NBATeams”);&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3" face="Lucida Sans"&gt;Our combobox then is bound like this. (We use telerik components in most if not all our projects)&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font size="3"&gt;&lt;font color="#ff0000" face="Lucida Sans"&gt;&amp;lt;telerik:RadComboBox ItemsSource="{Binding NBATeams}”&amp;gt;&amp;lt;/telerik:RadComboBox&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="3"&gt;This should give you a list in your combobox. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;We also set up another property in our ViewModel that is a just single object of NBATeams  - “SelectedNBATeam”&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;Our selectedItem in our combobox would look like, we would set this to a two way binding since we are sending data back.&lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font color="#ff0000" size="3"&gt;SelectedItem={Binding SelectedNBATeam, mode=TwoWay}”&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="3"&gt;This is all pretty straight forward and we use this pattern throughout all our applications. What do you do though when you have a combobox in a ItemsControl or ListBox? Here we have a list of NBA Teams that are a string that are being brought back from the database. We cant have the selected item be our LookupValue because the data is a string and its being bound in an ItemsControl. In the example above we would just have the combobox in a form. Here though we have it in a ItemsControl, where there is no selected item from the initial ItemsSource. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;In order to get the selected item to be displayed in the combobox you have to convert the LookupValue to a string. Then instead of using SelectedItem in the combobox use SelectedValue. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;To convert the LookupValue we do this.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;Create an observable collection of strings&lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font color="#ff0000" size="3"&gt;public ObservableCollection&amp;lt;string&amp;gt; NBATeams { get; set;}&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="3"&gt;Then convert your lookups to strings&lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font size="3"&gt;&lt;font color="#ff0000"&gt;var NBATeams = new ObservableCollection&amp;lt;string&amp;gt;(AppContext.Current.LookupService.GetLookupValues(“NBATeams”).Select(x =&amp;gt; x.DisplayText));&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;

  &lt;p&gt;This will give us a list of strings and our selected value should be bound to the NBATeams property in our ItemsSource in our ItemsControl.&lt;/p&gt;

  &lt;blockquote&gt;
    &lt;p&gt;&lt;font color="#ff0000"&gt;SelectedValue={Binding NBATeam, mode=TwoWay}”
        &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/10/144299.aspx</guid>
            <pubDate>Thu, 10 Mar 2011 21:20:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144299.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/10/144299.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144299.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144299.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight Binding with multiple collections</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/08/144249.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;We're designing some sport specific applications. In one of our views we have a gridview that is bound to an observable collection of Teams. This is pretty straight forward in terms of getting Teams bound to the GridView.&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2"&gt;&amp;lt;telerik:RadGridView Grid.Row="0" Grid.Column="0" x:Name="UsersGrid" ItemsSource="{Binding TeamResults}" SelectedItem="{Binding SelectedTeam, Mode=TwoWay}"&amp;gt;        &lt;br /&gt;&amp;lt;telerik:RadGridView.Columns&amp;gt;         &lt;br /&gt;&amp;lt;telerik:GridViewDataColumn Header="Name/Group" DataMemberBinding="{Binding TeamName}" MinWidth="150"&amp;gt;&amp;lt;/telerik:GridViewDataColumn&amp;gt;         &lt;br /&gt;&amp;lt;/telerik:RadGridView.Columns&amp;gt;         &lt;br /&gt;&amp;lt;/telerik:RadGridView&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2"&gt;We use the observable collection of teams as our items source and then bind the property of TeamName to the first column. You can set the binding to mode=TwoWay, we use a dialog where we edit the selected item, so our binding here is not set to two way.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The issue comes when we want to bind to a property that has another collection in it. To continue on our code from above, we have an observable collection of teams, within that collection we have a collection of KeyPeople. We get this collection using RIA Serivces with the code below. &lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font size="2"&gt;return _TeamsRepository.All().Include("KeyPerson");&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="2"&gt;Here we are getting all the teams and also including the KeyPerson entity. So when we are done with our Load we will end up with an observable collection of Teams with a navigation property / entity of KeyPerson. Within this KeyPerson entity is a list of people associated with that particular team. We want to display the head coach from this list of KeyPersons. This list currently has a list of ten or more people that are bound to this team, but we just want to display the Head Coach in the column next to team name.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The issue becomes how do we bind to this included entity? I have found about three different ways to solve this issue. The way that seemed to fit us best is to utilize the features within RIA Services. We can create client side properties that will do the work for us. We will create in the client side library a partial class of Team. We will end up in our library a file that is Team.shared.cs. The code below is what we will put into our partial team class.&lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p align="left"&gt;&lt;/p&gt;

  &lt;pre&gt;&lt;font size="2"&gt;        public KeyPerson Coach&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                if (this.KeyPerson != null &amp;amp;&amp;amp; this.KeyPerson.Any())&lt;br /&gt;                {&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;

  &lt;p align="left"&gt;&lt;/p&gt;

  &lt;pre&gt;&lt;code&gt;&lt;font size="2"&gt;                   return this.KeyPerson.Where(x =&amp;gt; x.RelationshipType == “HeadCoach”).FirstOrDefault(); &lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;

  &lt;p align="left"&gt;&lt;/p&gt;

  &lt;pre&gt;&lt;font size="2"&gt;                 }&lt;br /&gt; &lt;br /&gt;                return null;&lt;br /&gt;            }&lt;br /&gt;        }&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="2"&gt;We will return just the person that is the Head Coach and then be able to bind that and any other additional properties that we need. &lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font size="2"&gt;&amp;lt;telerik:GridViewDataColumn Header="Coach" DataMemberBinding="{Binding Coach.Name}" MinWidth="150"&amp;gt;&amp;lt;/telerik:GridViewDataColumn&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;font size="2"&gt;There are other ways that we could have solved this issue but we felt that creating a partial class through RIA Services best suited our needs.&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144249.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/08/144249.aspx</guid>
            <pubDate>Tue, 08 Mar 2011 19:16:17 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144249.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/08/144249.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144249.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144249.aspx</trackback:ping>
        </item>
        <item>
            <title>MSDN Search Help</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/07/144232.aspx</link>
            <description>&lt;p&gt;Looks like MSDN has made a change to their search. If you navigate to &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com"&gt;http://msdn.microsoft.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will see their search on the top of the page. If you put in a search term, Silverlight DataBinding&lt;/p&gt;
&lt;p&gt;You will see results that are pulled from the forums of msdn, stackover flow and a few other places. You will also be able to see the number of replies to the thread and the threads that have been answered. &lt;/p&gt;
&lt;p&gt;Great resource..&lt;/p&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144232.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/07/144232.aspx</guid>
            <pubDate>Mon, 07 Mar 2011 19:44:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144232.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/07/144232.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144232.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144232.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight Relay Commands</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/02/144159.aspx</link>
            <description>&lt;p&gt;&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;o:OfficeDocumentSettings&gt;
&lt;o:AllowPNG /&gt;
&lt;/o:OfficeDocumentSettings&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:TrackMoves&gt;false&lt;/w:TrackMoves&gt;
&lt;w:TrackFormatting /&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:DoNotPromoteQF /&gt;
&lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
&lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
&lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;w:SplitPgBreakAndParaMark /&gt;
&lt;w:EnableOpenTypeKerning /&gt;
&lt;w:DontFlipMirrorIndents /&gt;
&lt;w:OverrideTableStyleHps /&gt;
&lt;/w:Compatibility&gt;
&lt;m:mathPr&gt;
&lt;m:mathFont m:val="Cambria Math" /&gt;
&lt;m:brkBin m:val="before" /&gt;
&lt;m:brkBinSub m:val="&amp;#45;-" /&gt;
&lt;m:smallFrac m:val="off" /&gt;
&lt;m:dispDef /&gt;
&lt;m:lMargin m:val="0" /&gt;
&lt;m:rMargin m:val="0" /&gt;
&lt;m:defJc m:val="centerGroup" /&gt;
&lt;m:wrapIndent m:val="1440" /&gt;
&lt;m:intLim m:val="subSup" /&gt;
&lt;m:naryLim m:val="undOvr" /&gt;
&lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267"&gt;
&lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal" /&gt;
&lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 1" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 2" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 3" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 4" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 5" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 6" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 7" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 8" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 9" /&gt;
&lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /&gt;
&lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title" /&gt;
&lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /&gt;
&lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /&gt;
&lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong" /&gt;
&lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /&gt;
&lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /&gt;
&lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /&gt;
&lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title" /&gt;
&lt;w:LsdException Locked="false" Priority="37" Name="Bibliography" /&gt;
&lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;I am fairly new at Silverlight development and I usually have an issue that needs research every day. Which I enjoy, since I like the idea of going into a day knowing that I am &lt;span style=""&gt; &lt;/span&gt;going to learn something new. The issue that I am currently working on centers around relay commands. I have a pretty good handle on Relay Commands and how we use them within our applications.&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;Command&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: red;"&gt; ButtonCommand&lt;/span&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt;&lt;span style="color: red;"&gt; CommandParameter&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"NewRecruit"&lt;/span&gt;&lt;span style="color: red;"&gt; Content&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"New Recruit"&lt;/span&gt;&lt;span style="color: blue;"&gt; /&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;Here in our xaml we have a button. The button has a Command and a CommandParameter. The command binds to the ButtonCommand that we have in our ViewModel&lt;span style=""&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt; _buttonCommand;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Gets the button command.&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The button command.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt; ButtonCommand
        {
            &lt;span style="color: blue;"&gt;get&lt;/span&gt;
            {
                &lt;span style="color: blue;"&gt;if&lt;/span&gt; (_buttonCommand == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
                {
                    _buttonCommand = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt;(
                        x =&amp;gt; x != &lt;span style="color: blue;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; x.ToString().Length &amp;gt; 0 &amp;amp;&amp;amp; CheckCommandAvailable(x.ToString()),
                        x =&amp;gt; ExecuteCommand(x.ToString()));
                }
                &lt;span style="color: blue;"&gt;return&lt;/span&gt; _buttonCommand;
            }
        }&lt;/pre&gt;
&lt;p class="MsoNormal"&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;In our relay command we then do some checks with a lambda expression. We check if the command&lt;span style=""&gt;  &lt;/span&gt;parameter is null, is the length greater than 0 and we have a CheckCommandAvailable method that will tell&lt;span style=""&gt;  &lt;/span&gt;us if the button is even enabled. After we check on these three items we then pass the command parameter to an action method.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;This is all pretty straight forward, the issue that we solved a few days ago centered around having a control that needed to use a Relay Command and this control was a nested control and was using a different DataContext. The example below illustrates how we handled this scenario.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In our xaml usercontrol we had to set a name to this control.&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Controls3&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;RadTileViewItem&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"RecruitStatusTileView"&lt;/span&gt;
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;d&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"http://schemas.microsoft.com/expression/blend/2008"&lt;/span&gt;
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;mc&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt; 
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Controls1&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"&lt;/span&gt; 
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Controls2&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"&lt;/span&gt; 
   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Controls3&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"&lt;/span&gt; 
   &lt;span style="color: red;"&gt; mc&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Ignorable&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"d"&lt;/span&gt;&lt;span style="color: red;"&gt; d&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;DesignHeight&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"400"&lt;/span&gt;&lt;span style="color: red;"&gt; d&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;DesignWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"800"&lt;/span&gt;&lt;span style="color: red;"&gt; Header&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: red;"&gt; Title&lt;/span&gt;&lt;span style="color: blue;"&gt;,&lt;/span&gt;&lt;span style="color: red;"&gt;Mode&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;TwoWay&lt;/span&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt;&lt;span style="color: red;"&gt; MinimizedHeight&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"100"&lt;/span&gt; 
                          &lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"StatusView"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;Here we are using a telerik RadTileViewItem. We set the name of this control to “StatusView”. In our button control we set our command parameters and commands different than the example above.&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Consolas; color: rgb(163, 21, 21);"&gt;HyperlinkButton&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; Content&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;="{&lt;/span&gt;&lt;span style="font-family: Consolas; color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; BigBoardButtonText&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;,&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; Mode&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;=TwoWay}"&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; CommandParameter&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;="{&lt;/span&gt;&lt;span style="font-family: Consolas; color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt; 'Position.PositionName'}"&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; Command&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;="{&lt;/span&gt;&lt;span style="font-family: Consolas; color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; ElementName&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;=StatusView,&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; Path&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;=DataContext.BigBoardCommand,&lt;/span&gt;&lt;span style="font-family: Consolas; color: red;"&gt; Mode&lt;/span&gt;&lt;span style="font-family: Consolas; color: blue;"&gt;=TwoWay}" /&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;This hyperlink button lives in a ListBox control and this listbox has an ItemSource of PositionSelectors. The Command Parameter is binding to the Position.Position property of that PositionSelectors object. This again is pretty straight forward again. What gets a bit tricky is the Command property in the hyperlink. It is binding to the element name we created in the user control (StatusView) Because this hyperlink is in a listbox and is in the item template it doesn’t have a direct handle on the DataContext that the RadTileViewItem has so we have to make sure it does. We do that by binding to the element name of status view then set the path to DataContext.BigBoardCommand. BigBoardCommand is the name of the RelayCommand in the view model.&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt; _bigBoardCommand = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Gets the big board command.&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;The big board command.&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt; BigBoardCommand
        {
            &lt;span style="color: blue;"&gt;get&lt;/span&gt;
            {
                &lt;span style="color: blue;"&gt;if&lt;/span&gt; (_bigBoardCommand == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
                {
                    _bigBoardCommand = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RelayCommand&lt;/span&gt;(x =&amp;gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;, x =&amp;gt; AddToBigBoard(x.ToString()));
                }
                &lt;span style="color: blue;"&gt;return&lt;/span&gt; _bigBoardCommand;
            }
        }&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;From there we check for true again and then call the action and pass in the parameter that we had as the command parameter.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;What we are working on now is a bit trickier than this second example. In the above example we are only creating this TileViewItem with this name “StatusView” once. In another part of our application we are generating multiple TileViewItems, so we cannot set the name in the control as we cant have multiple controls with the same name. When we run the application we get an error that reads that the value is out of expected range. My searching has led me to think we cannot have multiple controls with the same name.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;This is today’s problem and Ill post the solution to this once it is found.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144159.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/02/144159.aspx</guid>
            <pubDate>Wed, 02 Mar 2011 15:38:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144159.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/02/144159.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144159.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144159.aspx</trackback:ping>
        </item>
        <item>
            <title>MVVM Properties with Resharper</title>
            <link>http://geekswithblogs.net/gevjen/archive/2011/03/02/144155.aspx</link>
            <description>&lt;p&gt;Read this early this morning and it is simple since we have all probably put together a code snippet. With the projects that we do at ArchitectNow we write alot of new custom views and view models, which results in having to write repetitive property code. We changed the context of the code a bit to suit our infrastructure but the idea is to have these properties created quickly.&lt;/p&gt;
&lt;p&gt;thanks to sparky dasrath for reminding us how easy this is to do&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sdasrath.blogspot.com/2011/02/20110221-resharper-c-snippet-for-mvvm.html"&gt;sdasrath.blogspot.com/2011/02/20110221-resharper-c-snippet-for-mvvm.html&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/144155.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2011/03/02/144155.aspx</guid>
            <pubDate>Wed, 02 Mar 2011 13:06:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/144155.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2011/03/02/144155.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/144155.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/144155.aspx</trackback:ping>
        </item>
        <item>
            <title>Entity Framework - When using table joins</title>
            <link>http://geekswithblogs.net/gevjen/archive/2010/11/09/142661.aspx</link>
            <description>&lt;p&gt;When you are working with join tables there are a few things that  have to be done in order to get a handle on the necessary properties.&lt;/p&gt;
&lt;p&gt;First, when you have a join table with no payload(meaning that only  two columns show up in the model, ex: UserID and GroupID) these entities  will not show up in the edmx. In our example the user table will show a  navigation property to the Group entity, and the Group entity will show  a navigation property to the User entity&lt;/p&gt;
&lt;p&gt;Even though those navigation properties show up and you feel that you will have a handle on them you will not.&lt;/p&gt;
&lt;p&gt;You will be unable to do this&lt;/p&gt;
&lt;p&gt;User _user = new User();&lt;/p&gt;
&lt;p&gt;_User.Groups.....&lt;/p&gt;
&lt;p&gt;If you have other entities that do not work off of join tables then you will be able to do this&lt;/p&gt;
&lt;p&gt;User _user = new User();&lt;/p&gt;
&lt;p&gt;_user.Program&lt;/p&gt;
&lt;p&gt;Because there is a join table there is some additional work that has  to be done in order to get a handle on this navigation property.&lt;/p&gt;
&lt;p&gt;Step 1: In the domain context class you have to change your calling  method to "include" the entity that you are looking to get a handle on.&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;
 &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span&gt;IQueryable&lt;/span&gt;&amp;lt;&lt;span&gt;User&lt;/span&gt;&amp;gt; GetUsersByProgramID(&lt;span style="color: blue;"&gt;int&lt;/span&gt; programID)
        {
            &lt;span style="color: blue;"&gt;return&lt;/span&gt; _userRepository.All().Where(x =&amp;gt; x.ProgramID == programID).Include(&lt;span&gt;"Groups"&lt;/span&gt;);
        }
&lt;/pre&gt;
&lt;p&gt;at the end of this method we are using the .Include("Groups") on the GetUserByProgramID&lt;/p&gt;
&lt;p&gt;Step 2: in the domain context metadata you have to set some attributes on the groups property.&lt;/p&gt;
&lt;pre style="font-family: consolas;"&gt;
            [&lt;span&gt;Include&lt;/span&gt;]
            [&lt;span&gt;Association&lt;/span&gt;(&lt;span&gt;"Groups"&lt;/span&gt;, &lt;span&gt;"UserID"&lt;/span&gt;, &lt;span&gt;"GroupID"&lt;/span&gt;)]
            &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span&gt;EntityCollection&lt;/span&gt;&amp;lt;&lt;span&gt;Group&lt;/span&gt;&amp;gt; Groups
            {
                &lt;span style="color: blue;"&gt;get&lt;/span&gt;;
                &lt;span style="color: blue;"&gt;set&lt;/span&gt;;
            }&lt;/pre&gt;
&lt;p&gt;this is the internal sealed class UserMetadata - &lt;/p&gt;
&lt;p&gt;we have to set up the association - within that is the name of the entity and the two columns in the join table.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;another note - anytime that you are using an include  you should go  into the metadata class and set that property to [Include] - you dont  have to set the [Association] unless you are using a join table.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/gevjen/aggbug/142661.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2010/11/09/142661.aspx</guid>
            <pubDate>Wed, 10 Nov 2010 09:07:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/142661.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2010/11/09/142661.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/142661.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/142661.aspx</trackback:ping>
        </item>
    </channel>
</rss>
