<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments for digitalMoto.net</title>
	<atom:link href="http://digitalMoto.net/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitalMoto.net/blog</link>
	<description>Off-idle banter on motorcycling, software development and life in the Pacific Northwest.</description>
	<pubDate>Wed, 10 Mar 2010 08:49:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on One way to manage an &#8216;OK&#8217; button with WPF / MVVM by digital</title>
		<link>http://digitalMoto.net/blog/2009/11/20/one-way-to-manage-an-ok-button-with-wpf-mvvm/comment-page-1/#comment-8517</link>
		<dc:creator>digital</dc:creator>
		<pubDate>Wed, 09 Dec 2009 18:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://digitalMoto.net/blog/?p=1007#comment-8517</guid>
		<description>I found another way to do this, sort of.  Set the binding via ancestory to the parent window.
&lt;pre&gt;
{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=.}
&lt;/pre&gt;

In fact this doesn't really work.  The problem is the path.  You can define any child element via the path reference, btu I have not seen an easy way to define the einter window in the path.  "." doesn't work.  I'd imagine there is a way to do it with something like {RelativeSource Self} but I have not had time to research this further.

Why not?  What I've got works and reworking existing code is kind of a waste of time when I'm not feature complete yet.</description>
		<content:encoded><![CDATA[<p>I found another way to do this, sort of.  Set the binding via ancestory to the parent window.</p>
<pre>
{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=.}
</pre>
<p>In fact this doesn&#8217;t really work.  The problem is the path.  You can define any child element via the path reference, btu I have not seen an easy way to define the einter window in the path.  &#8220;.&#8221; doesn&#8217;t work.  I&#8217;d imagine there is a way to do it with something like {RelativeSource Self} but I have not had time to research this further.</p>
<p>Why not?  What I&#8217;ve got works and reworking existing code is kind of a waste of time when I&#8217;m not feature complete yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Convert Enum to String / String to Enum by digital</title>
		<link>http://digitalMoto.net/blog/2009/10/15/convert-enum-to-string-string-to-enum/comment-page-1/#comment-8516</link>
		<dc:creator>digital</dc:creator>
		<pubDate>Fri, 06 Nov 2009 21:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://digitalMoto.net/blog/?p=919#comment-8516</guid>
		<description>Having learned more, I realized I was working way too hard.  The enumeration can and will be converted into a usable object at run time.  Just wire it up.

View Model Code:
&lt;pre&gt;
public Media Media { get; set; }
public List&#60;media&#62; MediaList { get { return Enum.GetValues(typeof (Media)).Cast&#60;/media&#62;&#60;media&#62;().ToList(); } }
&lt;/pre&gt;

XAML Code:
&lt;pre&gt; 
&#60;ComboBox 
  x:Name="cbxMedia" 
  ItemsSource="{Binding MediaList}" 
  SelectedItem="{Binding Media}" 
  IsSynchronizedWithCurrentItem="True" 
/&#62;&lt;/pre&gt;

When the user changes selections on the screen, the background value is automatically converted to the correct enum value.  I had been thinking that everything had to be converted in to and out of string based objects.  Nope.  That is not to say that I am using a best practice.  I'm still gaining experience with WPF and the M-V-VM pattern.  

Of course, the other way to do this would be to express the enumeration as static resource in the XAML.  I looked at it.  I got it working, then decided that I was breaking too many rules because the View would have to know about the underlying business object.  The whole point in M-V-VM is to create ignorant Views.  The data context is the only thing the View should know.  So no embedded info on business layer objects.  

This works and it is simpler.  Simpler is always better, but not too simple.  To paraphrase Einstein.  

</description>
		<content:encoded><![CDATA[<p>Having learned more, I realized I was working way too hard.  The enumeration can and will be converted into a usable object at run time.  Just wire it up.</p>
<p>View Model Code:</p>
<pre>
public Media Media { get; set; }
public List&lt;media&gt; MediaList { get { return Enum.GetValues(typeof (Media)).Cast&lt;/media&gt;&lt;media&gt;().ToList(); } }
</pre>
<p>XAML Code:</p>
<pre>
&lt;ComboBox
  x:Name="cbxMedia"
  ItemsSource="{Binding MediaList}"
  SelectedItem="{Binding Media}"
  IsSynchronizedWithCurrentItem="True"
/&gt;</pre>
<p>When the user changes selections on the screen, the background value is automatically converted to the correct enum value.  I had been thinking that everything had to be converted in to and out of string based objects.  Nope.  That is not to say that I am using a best practice.  I&#8217;m still gaining experience with WPF and the M-V-VM pattern.  </p>
<p>Of course, the other way to do this would be to express the enumeration as static resource in the XAML.  I looked at it.  I got it working, then decided that I was breaking too many rules because the View would have to know about the underlying business object.  The whole point in M-V-VM is to create ignorant Views.  The data context is the only thing the View should know.  So no embedded info on business layer objects.  </p>
<p>This works and it is simpler.  Simpler is always better, but not too simple.  To paraphrase Einstein.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Are you meshed? by digital</title>
		<link>http://digitalMoto.net/blog/2009/10/15/are-you-meshed/comment-page-1/#comment-8515</link>
		<dc:creator>digital</dc:creator>
		<pubDate>Fri, 06 Nov 2009 20:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://digitalMoto.net/blog/?p=913#comment-8515</guid>
		<description>Uninstalled.  It was killing my performance.  Everytime I would recompile my code, it would start uploading ALL of the changes.  My machine would basically lock up for a while as the process ran in the background.  All I needed uploaded with the core .cs files.  I don't need the EXEs and all of the debugging info saved too.  

Then again, maybe there's a better way to use the tool...  My just managing your docs and not Visual Studio Project files would be more practical.</description>
		<content:encoded><![CDATA[<p>Uninstalled.  It was killing my performance.  Everytime I would recompile my code, it would start uploading ALL of the changes.  My machine would basically lock up for a while as the process ran in the background.  All I needed uploaded with the core .cs files.  I don&#8217;t need the EXEs and all of the debugging info saved too.  </p>
<p>Then again, maybe there&#8217;s a better way to use the tool&#8230;  My just managing your docs and not Visual Studio Project files would be more practical.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PIR: Oct 11th by digital</title>
		<link>http://digitalMoto.net/blog/2009/10/11/pir-oct-11th/comment-page-1/#comment-8514</link>
		<dc:creator>digital</dc:creator>
		<pubDate>Mon, 12 Oct 2009 22:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://digitalMoto.net/blog/?p=843#comment-8514</guid>
		<description>I'm working on getting some pics of yesterday's events.  There were two pro photographers at the track.  Both say they have pics and since I was the only KTM at the track yesterday...  

I'll have to find something I like and get the legal stuff worked out to post them here.  We'll see what comes.  I'm working on it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m working on getting some pics of yesterday&#8217;s events.  There were two pro photographers at the track.  Both say they have pics and since I was the only KTM at the track yesterday&#8230;  </p>
<p>I&#8217;ll have to find something I like and get the legal stuff worked out to post them here.  We&#8217;ll see what comes.  I&#8217;m working on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Data Issues by digital</title>
		<link>http://digitalMoto.net/blog/2009/10/02/data-issues/comment-page-1/#comment-8513</link>
		<dc:creator>digital</dc:creator>
		<pubDate>Tue, 06 Oct 2009 17:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://digitalMoto.net/blog/?p=783#comment-8513</guid>
		<description>I setup triggers (insert/update/delete) on the database.  Nothing happened.  So...  The app was not actually sending the update stream to the database.  The easiest solution was to role back the install to a previous version.  This didn't help me understand what went wrong but it did get a working version of the app back on to user desktops before Monday at 8am.</description>
		<content:encoded><![CDATA[<p>I setup triggers (insert/update/delete) on the database.  Nothing happened.  So&#8230;  The app was not actually sending the update stream to the database.  The easiest solution was to role back the install to a previous version.  This didn&#8217;t help me understand what went wrong but it did get a working version of the app back on to user desktops before Monday at 8am.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
