<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:georss="http://www.georss.org/georss" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>DotNetDude.com</title>
    <link>http://www.dotnetdude.com/</link>
    <description>Miguel A. Castro's Blog</description>
    <image>
      <url>http://www.dotnetdude.com/feed-icon-24x24.gif</url>
      <title>DotNetDude.com</title>
      <link>http://www.dotnetdude.com/</link>
    </image>
    <language>en-us</language>
    <copyright>Miguel A. Castro</copyright>
    <lastBuildDate>Wed, 01 Feb 2012 16:26:58 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>miguelcastro67@gmail.com</managingEditor>
    <webMaster>miguelcastro67@gmail.com</webMaster>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=572a71f7-bbab-4da8-88dc-bb11365927ad</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,572a71f7-bbab-4da8-88dc-bb11365927ad.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,572a71f7-bbab-4da8-88dc-bb11365927ad.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=572a71f7-bbab-4da8-88dc-bb11365927ad</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Funny how 10 years ago, I was reading publications and listening to sessions by many
of the people that today I have the honor and pleasure of calling my friends. It’s
been a hell of a ride being active in the .NET community and I owe a lot of the beginnings
of that to INETA. Traveling around the country, speaking at user groups and meeting
many, many talented developers (some of whom have become friends of mine) has been
one of the highlights of my community involvement. It was another good friend of mine,
Bill Wolff, that introduced me to INETA and since then there have been a number of
good people involved. Nancy, Scott, Rob, Chris, Trish, Lori, and many others. All
of them made the organization a big priority in their lives and careers and it thrives
today because of that collective effort. And it’s not just about the fun I and others
have had as speakers; many user groups owe a lot to INETA for their support. I hope
the organization continues to be the glue for the symbiotic relationship between those
who run the groups and those who speak at them.
</p>
        <p>
So a lot has evolved and changed over the years in the formula that defines the interaction
between the groups and the speakers, but one thing has remained. INETA is still the
primary user group support mechanism out there. I still get to travel around and speak
to great developers around the country and sample what they try to pass of as pizza
(they forget I’m from Jersey). 
</p>
        <p>
Happy anniversary INETA; may the next 10 years be even better, even though pizza outside
of Jersey will probably get worse.
</p>
        <h3>
          <em>Until next time…</em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=572a71f7-bbab-4da8-88dc-bb11365927ad" />
      </body>
      <title>Happy 10th Anniversary INETA</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,572a71f7-bbab-4da8-88dc-bb11365927ad.aspx</guid>
      <link>http://www.dotnetdude.com/2012/02/01/Happy10thAnniversaryINETA.aspx</link>
      <pubDate>Wed, 01 Feb 2012 16:26:58 GMT</pubDate>
      <description>&lt;p&gt;
Funny how 10 years ago, I was reading publications and listening to sessions by many
of the people that today I have the honor and pleasure of calling my friends. It’s
been a hell of a ride being active in the .NET community and I owe a lot of the beginnings
of that to INETA. Traveling around the country, speaking at user groups and meeting
many, many talented developers (some of whom have become friends of mine) has been
one of the highlights of my community involvement. It was another good friend of mine,
Bill Wolff, that introduced me to INETA and since then there have been a number of
good people involved. Nancy, Scott, Rob, Chris, Trish, Lori, and many others. All
of them made the organization a big priority in their lives and careers and it thrives
today because of that collective effort. And it’s not just about the fun I and others
have had as speakers; many user groups owe a lot to INETA for their support. I hope
the organization continues to be the glue for the symbiotic relationship between those
who run the groups and those who speak at them.
&lt;/p&gt;
&lt;p&gt;
So a lot has evolved and changed over the years in the formula that defines the interaction
between the groups and the speakers, but one thing has remained. INETA is still the
primary user group support mechanism out there. I still get to travel around and speak
to great developers around the country and sample what they try to pass of as pizza
(they forget I’m from Jersey). 
&lt;/p&gt;
&lt;p&gt;
Happy anniversary INETA; may the next 10 years be even better, even though pizza outside
of Jersey will probably get worse.
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Until next time…&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=572a71f7-bbab-4da8-88dc-bb11365927ad" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,572a71f7-bbab-4da8-88dc-bb11365927ad.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=caf5772f-866f-4a36-97ee-44a700d3445e</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,caf5772f-866f-4a36-97ee-44a700d3445e.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,caf5772f-866f-4a36-97ee-44a700d3445e.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=caf5772f-866f-4a36-97ee-44a700d3445e</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m headed to the <a href="http://www.vslive.com" target="_blank">Visual Studio Live</a> conference
in Las Vegas on Sunday. I'll be doing a full-day precon on WCF on Monday then two
WPF talks on Tuesday.
</p>
        <p>
If you’re going to be there, please stop by and say hi !
</p>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=caf5772f-866f-4a36-97ee-44a700d3445e" />
      </body>
      <title>Upcoming Visual Studio Live next week</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,caf5772f-866f-4a36-97ee-44a700d3445e.aspx</guid>
      <link>http://www.dotnetdude.com/2011/04/15/UpcomingVisualStudioLiveNextWeek.aspx</link>
      <pubDate>Fri, 15 Apr 2011 16:26:50 GMT</pubDate>
      <description>&lt;p&gt;
I’m headed to the &lt;a href="http://www.vslive.com" target="_blank"&gt;Visual Studio Live&lt;/a&gt; conference
in Las Vegas on Sunday. I'll be doing a full-day precon on WCF on Monday then two
WPF talks on Tuesday.
&lt;/p&gt;
&lt;p&gt;
If you’re going to be there, please stop by and say hi !
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=caf5772f-866f-4a36-97ee-44a700d3445e" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,caf5772f-866f-4a36-97ee-44a700d3445e.aspx</comments>
      <category>Speaking Events</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>
            <em>Update:</em>
          </strong>
        </p>
        <p>
Nice blog post from an attendee: <a href="http://bejabbers2.blogspot.com/2011/03/inaugural-devready-event-on-mvvm.html">http://bejabbers2.blogspot.com/2011/03/inaugural-devready-event-on-mvvm.html</a></p>
        <p>
----------------------------------------------------
</p>
        <p>
A big thank you to all who made it out to the <a href="http://www.devready.net/" target="_blank">DevReady</a> MVVM
events we put together on the 19th and the 21st in the Microsoft Philly and NYC offices!
</p>
        <p>
The turnout was fantastic and the feedback I’ve seen so far has exceeded my expectations.
</p>
        <p>
We had five sessions set up and they went as follows:
</p>
        <ol>
          <li>
XAML: Achieving your moment of clarity 
</li>
          <li>
Programming with MVVM 
</li>
          <li>
Programming with MVVM – Advanced Topics 
</li>
          <li>
Platform Reusability with MVVM – also known as “How MVVM saved my butt and how laziness
came back to bite me” 
</li>
          <li>
Intro to Prism – previously “Leveraging Controls to Build XAML-based applications”</li>
        </ol>
        <p>
The first three sessions were done by me in what can be construed as a very painful
delivery process, but not because of the sessions. A couple of days before, I woke
up with an inflamed nerve in my left hip and I was in pretty intense pain for a while.
I was walking with a cane and was popping Alleve like Dr. House pops Vitaken. By the
time the first event (Philly) came around, I was better but nowhere near 100%. Luckily
it was offset by a beautiful day on Thursday and I got to ride from Jersey down to
Philly Intl. with the top down, seriously raising my mood.
</p>
        <p>
What was I doing in Philly Intl you ask? That gets me to the most important point
regarding these events. I was picking up a friend of mine who’s an evangelist for <a href="http://www.devexpress.com" target="_blank">DevExpress</a>.
DevExpress graciously put up the sole sponsorship for both these events and provided
everyone with both breakfast and lunch, along with several product licenses. On top
of that, they flew <a href="http://community.devexpress.com/blogs/seth/default.aspx" target="_blank">Seth
Juarez</a> out to deliver one of the sessions, during which Seth also demonstrated
the power and versatility of using DevExpress tools in WPF and Silverlight while also
teaching attendees how to use the Prism framework.
</p>
        <p>
          <a href="http://smallandmighty.net/" target="_blank">Dani Diaz</a>, the Microsoft
Developer Evangelist for the Philly area delivered the fourth session at both events.
Dani did a terrific job showing everyone how to take what I had just taught them and
reuse it among a desktop and Phone 7 application.
</p>
        <p>
Also, a great thank you to my own Developer Evangelist, <a href="http://blogs.msdn.com/b/peterlau/" target="_blank">Peter
Laudati</a>, for putting together all the tedious logistics at the NY offices. Anyone
who has ever tried to throw an event in any Microsoft office knows that it is not
a trivial process logistically and kudos goes out to both Peter and Dani for grabbing
the bull by the horns on this one.
</p>
        <p>
We’ve already received requests for repeating this event in other regions, possibly
starting with the Capital Area, so DC here we come.
</p>
        <p>
Once again, thank you to all involved in the events and thank you to the attendees
for making it so much fun and putting up with my bizarre and sometimes unorthodox
sense of humor; and most of all thank you to <a href="www.devexpress.com" target="_blank">Developer
Express</a>, without whom these events could not have taken place.
</p>
        <p>
Stay on top of the <a href="http://www.devready.net/" target="_blank">DevReady</a> web
site. There you can find out about more events and also about exactly what the DevReady
concept is.
</p>
        <p>
My session material for both these events can be found on the <a href="www.dotnetdude.com/downloads" target="_blank">Downloads</a> section
of this site. The rest can be found on the <a href="http://www.devready.net/" target="_blank">DevReady</a> web
site.
</p>
        <p>
 
</p>
        <h3>
          <em>Until next time…</em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370" />
      </body>
      <title>Get DevReady with MVVM–Success!</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370.aspx</guid>
      <link>http://www.dotnetdude.com/2011/03/25/GetDevReadyWithMVVMSuccess.aspx</link>
      <pubDate>Fri, 25 Mar 2011 15:34:28 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;&lt;em&gt;Update:&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Nice blog post from an attendee: &lt;a href="http://bejabbers2.blogspot.com/2011/03/inaugural-devready-event-on-mvvm.html"&gt;http://bejabbers2.blogspot.com/2011/03/inaugural-devready-event-on-mvvm.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
----------------------------------------------------
&lt;/p&gt;
&lt;p&gt;
A big thank you to all who made it out to the &lt;a href="http://www.devready.net/" target="_blank"&gt;DevReady&lt;/a&gt; MVVM
events we put together on the 19th and the 21st in the Microsoft Philly and NYC offices!
&lt;/p&gt;
&lt;p&gt;
The turnout was fantastic and the feedback I’ve seen so far has exceeded my expectations.
&lt;/p&gt;
&lt;p&gt;
We had five sessions set up and they went as follows:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
XAML: Achieving your moment of clarity 
&lt;li&gt;
Programming with MVVM 
&lt;li&gt;
Programming with MVVM – Advanced Topics 
&lt;li&gt;
Platform Reusability with MVVM – also known as “How MVVM saved my butt and how laziness
came back to bite me” 
&lt;li&gt;
Intro to Prism – previously “Leveraging Controls to Build XAML-based applications”&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The first three sessions were done by me in what can be construed as a very painful
delivery process, but not because of the sessions. A couple of days before, I woke
up with an inflamed nerve in my left hip and I was in pretty intense pain for a while.
I was walking with a cane and was popping Alleve like Dr. House pops Vitaken. By the
time the first event (Philly) came around, I was better but nowhere near 100%. Luckily
it was offset by a beautiful day on Thursday and I got to ride from Jersey down to
Philly Intl. with the top down, seriously raising my mood.
&lt;/p&gt;
&lt;p&gt;
What was I doing in Philly Intl you ask? That gets me to the most important point
regarding these events. I was picking up a friend of mine who’s an evangelist for &lt;a href="http://www.devexpress.com" target="_blank"&gt;DevExpress&lt;/a&gt;.
DevExpress graciously put up the sole sponsorship for both these events and provided
everyone with both breakfast and lunch, along with several product licenses. On top
of that, they flew &lt;a href="http://community.devexpress.com/blogs/seth/default.aspx" target="_blank"&gt;Seth
Juarez&lt;/a&gt; out to deliver one of the sessions, during which Seth also demonstrated
the power and versatility of using DevExpress tools in WPF and Silverlight while also
teaching attendees how to use the Prism framework.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://smallandmighty.net/" target="_blank"&gt;Dani Diaz&lt;/a&gt;, the Microsoft
Developer Evangelist for the Philly area delivered the fourth session at both events.
Dani did a terrific job showing everyone how to take what I had just taught them and
reuse it among a desktop and Phone 7 application.
&lt;/p&gt;
&lt;p&gt;
Also, a great thank you to my own Developer Evangelist, &lt;a href="http://blogs.msdn.com/b/peterlau/" target="_blank"&gt;Peter
Laudati&lt;/a&gt;, for putting together all the tedious logistics at the NY offices. Anyone
who has ever tried to throw an event in any Microsoft office knows that it is not
a trivial process logistically and kudos goes out to both Peter and Dani for grabbing
the bull by the horns on this one.
&lt;/p&gt;
&lt;p&gt;
We’ve already received requests for repeating this event in other regions, possibly
starting with the Capital Area, so DC here we come.
&lt;/p&gt;
&lt;p&gt;
Once again, thank you to all involved in the events and thank you to the attendees
for making it so much fun and putting up with my bizarre and sometimes unorthodox
sense of humor; and most of all thank you to &lt;a href="www.devexpress.com" target="_blank"&gt;Developer
Express&lt;/a&gt;, without whom these events could not have taken place.
&lt;/p&gt;
&lt;p&gt;
Stay on top of the &lt;a href="http://www.devready.net/" target="_blank"&gt;DevReady&lt;/a&gt; web
site. There you can find out about more events and also about exactly what the DevReady
concept is.
&lt;/p&gt;
&lt;p&gt;
My session material for both these events can be found on the &lt;a href="www.dotnetdude.com/downloads" target="_blank"&gt;Downloads&lt;/a&gt; section
of this site. The rest can be found on the &lt;a href="http://www.devready.net/" target="_blank"&gt;DevReady&lt;/a&gt; web
site.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Until next time…&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,cb7f3676-6b5e-4a1c-87ec-f9b4b8a95370.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=26f80ed0-a2d4-4692-b9bf-bed9f2394dc7</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,26f80ed0-a2d4-4692-b9bf-bed9f2394dc7.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,26f80ed0-a2d4-4692-b9bf-bed9f2394dc7.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=26f80ed0-a2d4-4692-b9bf-bed9f2394dc7</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m running two events in the northeast called MVVM DevReady coming up this month.
</p>
        <p>
The first one is in Philly (Malvern actually) and will run on Saturday the 19th of
March.  The second is the following Monday, the 21st, in the NYC Microsoft office.
</p>
        <p>
Both events are <strong>FREE</strong> of charge but registration is limited and is
quickly filling up.  We just put up the registration site yesterday and are more
than half full already.
</p>
        <p>
I will be giving the first three sessions, with the local DE giving the fourth, and
our sponsor providing the last session of the day. These events could not have been
possible if not for our sponsor, <a href="http://www.devexpress.com/" target="_blank">Developer
Express</a>.  They are not only covering event expenses but are flying out one
of their chief evangelists, <a href="http://community.devexpress.com/blogs/seth/default.aspx" target="_blank">Seth
Juarez</a>, to present the session personally.
</p>
        <p>
The registration sites are:
</p>
        <p>
3/19/2011 - Philly: <a href="http://devready-estw.eventbrite.com/">http://devready-estw.eventbrite.com/</a></p>
        <p>
3/21/2011 - NYC: <a href="http://devreadynyc.eventbrite.com/">http://devreadynyc.eventbrite.com/</a></p>
        <p>
          <br />
Get your development skills ready for MVVM (Model View View Model Design Pattern)
and build some exciting applications for WPF, Silverlight or Windows Phone. In this
all day event you will learn everything you need to know to get start with MVVM. We
will start with the basics and end with some more advance topics. 
</p>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=26f80ed0-a2d4-4692-b9bf-bed9f2394dc7" />
      </body>
      <title>MVVM DevReady Events in NYC &amp; Philly</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,26f80ed0-a2d4-4692-b9bf-bed9f2394dc7.aspx</guid>
      <link>http://www.dotnetdude.com/2011/03/09/MVVMDevReadyEventsInNYCPhilly.aspx</link>
      <pubDate>Wed, 09 Mar 2011 20:17:43 GMT</pubDate>
      <description>&lt;p&gt;
I’m running two events in the northeast called MVVM DevReady coming up this month.
&lt;/p&gt;
&lt;p&gt;
The first one is in Philly (Malvern actually) and will run on Saturday the 19th of
March.&amp;nbsp; The second is the following Monday, the 21st, in the NYC Microsoft office.
&lt;/p&gt;
&lt;p&gt;
Both events are &lt;strong&gt;FREE&lt;/strong&gt; of charge but registration is limited and is
quickly filling up.&amp;nbsp; We just put up the registration site yesterday and are more
than half full already.
&lt;/p&gt;
&lt;p&gt;
I will be giving the first three sessions, with the local DE giving the fourth, and
our sponsor providing the last session of the day. These events could not have been
possible if not for our sponsor, &lt;a href="http://www.devexpress.com/" target="_blank"&gt;Developer
Express&lt;/a&gt;.&amp;nbsp; They are not only covering event expenses but are flying out one
of their chief evangelists, &lt;a href="http://community.devexpress.com/blogs/seth/default.aspx" target="_blank"&gt;Seth
Juarez&lt;/a&gt;, to present the session personally.
&lt;/p&gt;
&lt;p&gt;
The registration sites are:
&lt;/p&gt;
&lt;p&gt;
3/19/2011 - Philly: &lt;a href="http://devready-estw.eventbrite.com/"&gt;http://devready-estw.eventbrite.com/&lt;/a&gt; 
&lt;p&gt;
3/21/2011 - NYC: &lt;a href="http://devreadynyc.eventbrite.com/"&gt;http://devreadynyc.eventbrite.com/&lt;/a&gt; 
&lt;p&gt;
&lt;br&gt;
Get your development skills ready for MVVM (Model View View Model Design Pattern)
and build some exciting applications for WPF, Silverlight or Windows Phone. In this
all day event you will learn everything you need to know to get start with MVVM. We
will start with the basics and end with some more advance topics. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=26f80ed0-a2d4-4692-b9bf-bed9f2394dc7" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,26f80ed0-a2d4-4692-b9bf-bed9f2394dc7.aspx</comments>
      <category>Dev Stuff</category>
      <category>Speaking Events</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=982904ee-baaa-42b4-a5e8-496be9c98009</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,982904ee-baaa-42b4-a5e8-496be9c98009.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,982904ee-baaa-42b4-a5e8-496be9c98009.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=982904ee-baaa-42b4-a5e8-496be9c98009</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve been beating my head against the wall with a small problem and after lots of
trial and error, and some searching around, I found the answer – and it was NOT obvious
!
</p>
        <p>
The problem space was simple and common:
</p>
        <p>
I have placed a lot of my styles, data templates, and converters into separate XAML
files (ResourceDictionaries), with the idea of just declaring them in the App.Xaml
since I’m pretty much using these all over the application.  I started out declaring
things in my App.Xaml like this:
</p>
        <p>
 
</p>
        <pre class="brush: xml;">&lt;Application.Resources&gt;
    &lt;controls:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" /&gt;
    &lt;refractionConverter:ReverseBooleanToVisibilityConverter x:Key="reverseBooleanToVisibilityConverter" /&gt;
    &lt;refractionConverter:PercentageConverter x:Key="percentageConverter" /&gt;
    &lt;ResourceDictionary&gt;
        &lt;ResourceDictionary.MergedDictionaries&gt;
            &lt;ResourceDictionary&gt;
            &lt;/ResourceDictionary&gt;
            &lt;ResourceDictionary Source="Resources/SharedResources.xaml" /&gt;
            &lt;ResourceDictionary Source="Resources/MdiTemplates.xaml" /&gt;
        &lt;/ResourceDictionary.MergedDictionaries&gt;
    &lt;/ResourceDictionary&gt;
&lt;/Application.Resources&gt;

</pre>
        <p>
 
</p>
        <p>
Looks simple enough right?  Wrong.
</p>
        <p>
The second I moved the converters from the individual User Controls to the <strong>App.Xaml</strong>,
styles that are declared in the <strong>SharedResources.xaml</strong> file became
unreachable.  In my debugging efforts, I tapped into the <strong>Application_Startup</strong> event
to examine the resources that WPF was loading.  I noticed that the value of <strong>this.Resources.Count</strong> was <strong>4</strong>,
but the value of <strong>this.Resources.MergedDictionaries.Count</strong> was <strong>0</strong>.  
</p>
        <p>
So I continued digging and here’s what I found out:
</p>
        <p>
Once you commit to using <strong>MergedDictionaries</strong> in your <strong>App.Xaml</strong>,
you must use them for everything.  I moved the three converters inside the <strong>MergedDictionaries</strong> section
and tested the debugging again.  This time, <strong>this.Resources.Count</strong> was
set to <strong>0</strong>, and <strong>this.Resources.MergedDictionaries.Count</strong> was
set to <strong>3</strong>.  This told me the resources I listed as <strong>MergedDictionaries</strong> were
now loading.  The key indicator that things were better is that my styles now
worked.
</p>
        <p>
Here’s the code:
</p>
        <p>
 
</p>
        <pre class="brush: xml;">&lt;Application.Resources&gt;
    &lt;ResourceDictionary&gt;
        &lt;ResourceDictionary.MergedDictionaries&gt;
            &lt;ResourceDictionary&gt;
                &lt;controls:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" /&gt;
                &lt;refractionConverter:ReverseBooleanToVisibilityConverter x:Key="reverseBooleanToVisibilityConverter" /&gt;
                &lt;refractionConverter:PercentageConverter x:Key="percentageConverter" /&gt;
            &lt;/ResourceDictionary&gt;
            &lt;ResourceDictionary Source="Resources/SharedResources.xaml" /&gt;
            &lt;ResourceDictionary Source="Resources/MdiTemplates.xaml" /&gt;
        &lt;/ResourceDictionary.MergedDictionaries&gt;
    &lt;/ResourceDictionary&gt;
&lt;/Application.Resources&gt;

</pre>
        <p>
 
</p>
        <p>
I hope this helps since believe it or not, though there’s a lot of code samples out
there, much of it is unclear and flat out wrong.
</p>
        <h3>
          <em>Until next time…</em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=982904ee-baaa-42b4-a5e8-496be9c98009" />
      </body>
      <title>Resource Dictionaries Are Making My Hair Hurt!</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,982904ee-baaa-42b4-a5e8-496be9c98009.aspx</guid>
      <link>http://www.dotnetdude.com/2011/01/23/ResourceDictionariesAreMakingMyHairHurt.aspx</link>
      <pubDate>Sun, 23 Jan 2011 20:24:02 GMT</pubDate>
      <description>&lt;p&gt;
I’ve been beating my head against the wall with a small problem and after lots of
trial and error, and some searching around, I found the answer – and it was NOT obvious
!
&lt;/p&gt;
&lt;p&gt;
The problem space was simple and common:
&lt;/p&gt;
&lt;p&gt;
I have placed a lot of my styles, data templates, and converters into separate XAML
files (ResourceDictionaries), with the idea of just declaring them in the App.Xaml
since I’m pretty much using these all over the application.&amp;nbsp; I started out declaring
things in my App.Xaml like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;Application.Resources&amp;gt;
    &amp;lt;controls:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" /&amp;gt;
    &amp;lt;refractionConverter:ReverseBooleanToVisibilityConverter x:Key="reverseBooleanToVisibilityConverter" /&amp;gt;
    &amp;lt;refractionConverter:PercentageConverter x:Key="percentageConverter" /&amp;gt;
    &amp;lt;ResourceDictionary&amp;gt;
        &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
            &amp;lt;ResourceDictionary&amp;gt;
            &amp;lt;/ResourceDictionary&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/SharedResources.xaml" /&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/MdiTemplates.xaml" /&amp;gt;
        &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
    &amp;lt;/ResourceDictionary&amp;gt;
&amp;lt;/Application.Resources&amp;gt;

&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Looks simple enough right?&amp;nbsp; Wrong.
&lt;/p&gt;
&lt;p&gt;
The second I moved the converters from the individual User Controls to the &lt;strong&gt;App.Xaml&lt;/strong&gt;,
styles that are declared in the &lt;strong&gt;SharedResources.xaml&lt;/strong&gt; file became
unreachable.&amp;nbsp; In my debugging efforts, I tapped into the &lt;strong&gt;Application_Startup&lt;/strong&gt; event
to examine the resources that WPF was loading.&amp;nbsp; I noticed that the value of &lt;strong&gt;this.Resources.Count&lt;/strong&gt; was &lt;strong&gt;4&lt;/strong&gt;,
but the value of &lt;strong&gt;this.Resources.MergedDictionaries.Count&lt;/strong&gt; was &lt;strong&gt;0&lt;/strong&gt;.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
So I continued digging and here’s what I found out:
&lt;/p&gt;
&lt;p&gt;
Once you commit to using &lt;strong&gt;MergedDictionaries&lt;/strong&gt; in your &lt;strong&gt;App.Xaml&lt;/strong&gt;,
you must use them for everything.&amp;nbsp; I moved the three converters inside the &lt;strong&gt;MergedDictionaries&lt;/strong&gt; section
and tested the debugging again.&amp;nbsp; This time, &lt;strong&gt;this.Resources.Count&lt;/strong&gt; was
set to &lt;strong&gt;0&lt;/strong&gt;, and &lt;strong&gt;this.Resources.MergedDictionaries.Count&lt;/strong&gt; was
set to &lt;strong&gt;3&lt;/strong&gt;.&amp;nbsp; This told me the resources I listed as &lt;strong&gt;MergedDictionaries&lt;/strong&gt; were
now loading.&amp;nbsp; The key indicator that things were better is that my styles now
worked.
&lt;/p&gt;
&lt;p&gt;
Here’s the code:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;Application.Resources&amp;gt;
    &amp;lt;ResourceDictionary&amp;gt;
        &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
            &amp;lt;ResourceDictionary&amp;gt;
                &amp;lt;controls:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" /&amp;gt;
                &amp;lt;refractionConverter:ReverseBooleanToVisibilityConverter x:Key="reverseBooleanToVisibilityConverter" /&amp;gt;
                &amp;lt;refractionConverter:PercentageConverter x:Key="percentageConverter" /&amp;gt;
            &amp;lt;/ResourceDictionary&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/SharedResources.xaml" /&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/MdiTemplates.xaml" /&amp;gt;
        &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
    &amp;lt;/ResourceDictionary&amp;gt;
&amp;lt;/Application.Resources&amp;gt;

&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I hope this helps since believe it or not, though there’s a lot of code samples out
there, much of it is unclear and flat out wrong.
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Until next time…&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=982904ee-baaa-42b4-a5e8-496be9c98009" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,982904ee-baaa-42b4-a5e8-496be9c98009.aspx</comments>
      <category>Dev Stuff</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=ad7991b3-12d2-44bf-a39b-4050d18d2850</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,ad7991b3-12d2-44bf-a39b-4050d18d2850.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,ad7991b3-12d2-44bf-a39b-4050d18d2850.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ad7991b3-12d2-44bf-a39b-4050d18d2850</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ll be doing a user group triple play this month starting on Tuesday, Dec. 14 at
the <a href="http://www.setfocus.com/n3ug/welcome.aspx" target="_blank">Northern New
Jersey .NET User Group</a>.  On Wednesday, the 15th, I’ll be at the <a href="http://www.phillydotnet.org/SitePages/Home.aspx" target="_blank">Philly
.NET User Group</a>, and on Thursday the 16th, I’ll be visiting the <a href="http://www.nycdotnetdev.com/" target="_blank">New
York City .NET User Group</a>.
</p>
        <p>
The topic will be the same across all three groups, though the name seems to be different
in each one.  I guess the common title would be, “<strong>Programming With MVVM</strong>”. 
Here’s the session description:
</p>
        <p>
WPF overwhelmed us with the most powerful data binding ever released in a development
platform. It seemed there was so much to learn in order to use it, but it really isn't
that complicated. However, to use it to its full potential, you really do need to
introduce the Model-View-ViewModel pattern. The ideas and goal around this pattern
seem to vary from person to person, but the one thing that they all share is that
it provides a point of binding for XAML pages. In this session, I'll show you what
MVVM is and how to use it and what to put in it, in order to get maximum potential
out of XAML binding. I'll even show you how to get a small MVVM Framework going for
sharing across all your applications.
</p>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=ad7991b3-12d2-44bf-a39b-4050d18d2850" />
      </body>
      <title>Upcoming Northeast MVVM Tour</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,ad7991b3-12d2-44bf-a39b-4050d18d2850.aspx</guid>
      <link>http://www.dotnetdude.com/2010/12/01/UpcomingNortheastMVVMTour.aspx</link>
      <pubDate>Wed, 01 Dec 2010 17:18:23 GMT</pubDate>
      <description>&lt;p&gt;
I’ll be doing a user group triple play this month starting on Tuesday, Dec. 14 at
the &lt;a href="http://www.setfocus.com/n3ug/welcome.aspx" target="_blank"&gt;Northern New
Jersey .NET User Group&lt;/a&gt;.&amp;nbsp; On Wednesday, the 15th, I’ll be at the &lt;a href="http://www.phillydotnet.org/SitePages/Home.aspx" target="_blank"&gt;Philly
.NET User Group&lt;/a&gt;, and on Thursday the 16th, I’ll be visiting the &lt;a href="http://www.nycdotnetdev.com/" target="_blank"&gt;New
York City .NET User Group&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The topic will be the same across all three groups, though the name seems to be different
in each one.&amp;nbsp; I guess the common title would be, “&lt;strong&gt;Programming With MVVM&lt;/strong&gt;”.&amp;nbsp;
Here’s the session description:
&lt;/p&gt;
&lt;p&gt;
WPF overwhelmed us with the most powerful data binding ever released in a development
platform. It seemed there was so much to learn in order to use it, but it really isn't
that complicated. However, to use it to its full potential, you really do need to
introduce the Model-View-ViewModel pattern. The ideas and goal around this pattern
seem to vary from person to person, but the one thing that they all share is that
it provides a point of binding for XAML pages. In this session, I'll show you what
MVVM is and how to use it and what to put in it, in order to get maximum potential
out of XAML binding. I'll even show you how to get a small MVVM Framework going for
sharing across all your applications.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=ad7991b3-12d2-44bf-a39b-4050d18d2850" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,ad7991b3-12d2-44bf-a39b-4050d18d2850.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=db29e291-f6bf-4bdf-8219-1510e528f332</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,db29e291-f6bf-4bdf-8219-1510e528f332.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,db29e291-f6bf-4bdf-8219-1510e528f332.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=db29e291-f6bf-4bdf-8219-1510e528f332</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m going to be a little different on this posting and talk about an actual pay-product
that is totally worth your while to look at.  The product I’m talking about is
called <strong>DocumentX 2010</strong> and it’s by a company called <a href="http://www.innovasys.com" target="_blank">Innovasys</a>.
</p>
        <p>
I’ve been dealing with Innovasys for a long time now.  Back when I first started
developing CodeBreeze, I was on the hunt for a good help authoring system in order
write a quality help system for my own applications and I came across the original
Document X.  First, let me tell you what Document X does.  Put simply, it
lets you develop MSDN-style documentation for your APIs and object models.  It
comes with its own full-feature IDE, but also fully integrates with Visual Studio
and also imports &lt;summary&gt;-style documentation directly from your code. 
Document X has the concept of content files that let you define all the documentation
for a specific assembly, then by creating a project file, you can important as many
content files as you want.  The end-result is a help file that can incorporate
multiple assemblies.  Innovasys also makes a sister product called <strong>Help
Studio</strong>, which is used to author complete help systems for your applications.  
With Help Studio you can create any number of topics, glossaries, and custom tables-of-content. 
Into a Help Studio project, you can important a Document X project, giving you a complete
single help file for your application that contains all your user-help, the way you
designed it, as well as the object-model documentation in MSDN format.
</p>
        <p>
The reason I felt it important to share my experience with you is because it was a
unique one.  Using the Document X product, along with its sister application,
Help Studio, I was inspired to take certain approaches during the design and development
of CodeBreeze.  As I used the product suite, I noticed that every part of the
application can be customized, including the templates for the help being generated. 
The usage of context menus, short-cuts, tabbed-MDI, and other UX details was extensive
and I became very impressed with the way the suite was built.  The guys at Innovasys
seem to go out of their way to provide the best and most intuitive user experience
possible.  Normally, the task of creating documentation can be quite tedious,
but the best compliment I can give Innovasys is that it’s a task that I actually enjoy.
</p>
        <p>
          <a href="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/FullDocXApp_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 18px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="FullDocXApp" border="0" alt="FullDocXApp" align="left" src="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/FullDocXApp_thumb.png" width="602" height="365" />
          </a>
        </p>
        <p>
The more I used the Document X and Help Studio product suite, the more I found myself
changing things in CodeBreeze to provide a better and better user experience. 
It became quite frustrating, but in a good way <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/wlEmoticon-smile_2.png" />. 
A couple of years later, at the Los Angeles PDC, I got the opportunity to meet the
Innovasys team after exchanging emails when them for a while and they were as pleasant
I person as they were on-line.  
</p>
        <p>
Document X is on its 2010 release and HelpStudio is about to be released as the 2011
version, both are written in WPF, and based on all the conversations I’ve had with
Innovasys, the applications have a solid architecture and do their predecessors proud
in all the usual attention to detail.
</p>
        <p>
I’ve had the opportunity to dialog quite a bit with Innovasys and it’s no surprise
their products are built so well.  It such a treat getting into real geeky conversations
with these guys.  Recently, our conversations have been about WPF, MVVM, abstractions,
templates, and other great technologies used in the latest versions of their products. 
The new versions of Document X and Help Studio are built entirely in WPF and I gotta
say that once again, their proving an inspiration in the next version of CodeBreeze,
to be released sometime next year.
</p>
        <p>
Be sure to check out their apps at <a href="http://www.innovasys.com">www.innovasys.com</a>,
where you can download a free trial for all their products.
</p>
        <p>
Keep up the great work guys.
</p>
        <h3>
          <em>Until next time…</em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=db29e291-f6bf-4bdf-8219-1510e528f332" />
      </body>
      <title>Inspiration by Application</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,db29e291-f6bf-4bdf-8219-1510e528f332.aspx</guid>
      <link>http://www.dotnetdude.com/2010/11/19/InspirationByApplication.aspx</link>
      <pubDate>Fri, 19 Nov 2010 22:07:19 GMT</pubDate>
      <description>&lt;p&gt;
I’m going to be a little different on this posting and talk about an actual pay-product
that is totally worth your while to look at.&amp;nbsp; The product I’m talking about is
called &lt;strong&gt;DocumentX 2010&lt;/strong&gt; and it’s by a company called &lt;a href="http://www.innovasys.com" target="_blank"&gt;Innovasys&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I’ve been dealing with Innovasys for a long time now.&amp;nbsp; Back when I first started
developing CodeBreeze, I was on the hunt for a good help authoring system in order
write a quality help system for my own applications and I came across the original
Document X.&amp;nbsp; First, let me tell you what Document X does.&amp;nbsp; Put simply, it
lets you develop MSDN-style documentation for your APIs and object models.&amp;nbsp; It
comes with its own full-feature IDE, but also fully integrates with Visual Studio
and also imports &amp;lt;summary&amp;gt;-style documentation directly from your code.&amp;nbsp;
Document X has the concept of content files that let you define all the documentation
for a specific assembly, then by creating a project file, you can important as many
content files as you want.&amp;nbsp; The end-result is a help file that can incorporate
multiple assemblies.&amp;nbsp; Innovasys also makes a sister product called &lt;strong&gt;Help
Studio&lt;/strong&gt;, which is used to author complete help systems for your applications.&amp;nbsp;&amp;nbsp;
With Help Studio you can create any number of topics, glossaries, and custom tables-of-content.&amp;nbsp;
Into a Help Studio project, you can important a Document X project, giving you a complete
single help file for your application that contains all your user-help, the way you
designed it, as well as the object-model documentation in MSDN format.
&lt;/p&gt;
&lt;p&gt;
The reason I felt it important to share my experience with you is because it was a
unique one.&amp;nbsp; Using the Document X product, along with its sister application,
Help Studio, I was inspired to take certain approaches during the design and development
of CodeBreeze.&amp;nbsp; As I used the product suite, I noticed that every part of the
application can be customized, including the templates for the help being generated.&amp;nbsp;
The usage of context menus, short-cuts, tabbed-MDI, and other UX details was extensive
and I became very impressed with the way the suite was built.&amp;nbsp; The guys at Innovasys
seem to go out of their way to provide the best and most intuitive user experience
possible.&amp;nbsp; Normally, the task of creating documentation can be quite tedious,
but the best compliment I can give Innovasys is that it’s a task that I actually enjoy.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/FullDocXApp_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 18px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="FullDocXApp" border="0" alt="FullDocXApp" align="left" src="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/FullDocXApp_thumb.png" width="602" height="365"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The more I used the Document X and Help Studio product suite, the more I found myself
changing things in CodeBreeze to provide a better and better user experience.&amp;nbsp;
It became quite frustrating, but in a good way &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.dotnetdude.com/content/binary/Windows-Live-Writer/052964c23242_E897/wlEmoticon-smile_2.png"&gt;.&amp;nbsp;
A couple of years later, at the Los Angeles PDC, I got the opportunity to meet the
Innovasys team after exchanging emails when them for a while and they were as pleasant
I person as they were on-line.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Document X is on its 2010 release and HelpStudio is about to be released as the 2011
version, both are written in WPF, and based on all the conversations I’ve had with
Innovasys, the applications have a solid architecture and do their predecessors proud
in all the usual attention to detail.
&lt;/p&gt;
&lt;p&gt;
I’ve had the opportunity to dialog quite a bit with Innovasys and it’s no surprise
their products are built so well.&amp;nbsp; It such a treat getting into real geeky conversations
with these guys.&amp;nbsp; Recently, our conversations have been about WPF, MVVM, abstractions,
templates, and other great technologies used in the latest versions of their products.&amp;nbsp;
The new versions of Document X and Help Studio are built entirely in WPF and I gotta
say that once again, their proving an inspiration in the next version of CodeBreeze,
to be released sometime next year.
&lt;/p&gt;
&lt;p&gt;
Be sure to check out their apps at &lt;a href="http://www.innovasys.com"&gt;www.innovasys.com&lt;/a&gt;,
where you can download a free trial for all their products.
&lt;/p&gt;
&lt;p&gt;
Keep up the great work guys.
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Until next time…&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=db29e291-f6bf-4bdf-8219-1510e528f332" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,db29e291-f6bf-4bdf-8219-1510e528f332.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=c7216025-62df-41bb-aae4-e2e3e207d311</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,c7216025-62df-41bb-aae4-e2e3e207d311.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,c7216025-62df-41bb-aae4-e2e3e207d311.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c7216025-62df-41bb-aae4-e2e3e207d311</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Oh boy, this one just drove me insane for over two hours.
</p>
        <p>
First of all, I have a ViewModel that is bound to a user control on a “start page”
of my application which is designed to show a Recent Files list.  The displaying
of this list worked just fine.  The ViewModel encapsulates a command member whose
execution method is within the ViewModel class itself.
</p>
        <p>
The command is declared and initialized in my view model like this:
</p>
        <p>
 
</p>
        <pre class="brush: csharp;">public override void InitializeViewModel()
{
    FileSelectedCommand = new DelegateCommand&lt;Uri&gt;(FileSelectedCommand_Execute);
    base.InitializeViewModel();
}

public DelegateCommand&lt;Uri&gt; FileSelectedCommand { get; protected set; }
</pre>
        <p>
 
</p>
        <p>
The command’s execution method looks like this, but what it’s doing is not what’s
important here.
</p>
        <p>
 
</p>
        <pre class="brush: csharp;">void FileSelectedCommand_Execute(Uri arg)
{
    if (arg != null)
    {
        _RecentDocManager.NotifyDocumentOpened(arg);
        OnFileSelected(new FileLocationEventArgs(arg));
    }
}
</pre>
        <p>
 
</p>
        <p>
What is important is the argument that it’s set up to receive.  Notice that in
this case, it’s a URI, which is the exact type to which the <strong>CommandParameter</strong> argument
in my view is bound:
</p>
        <p>
 
</p>
        <pre class="brush: xml;">&lt;src:StartPageViewBase.Resources&gt;
    &lt;shared:CommandReference x:Key="fileSelectedCommand" Command="{Binding Path=FileSelectedCommand}" /&gt;
    &lt;ResourceDictionary x:Key="dict1"&gt;
        &lt;ResourceDictionary.MergedDictionaries&gt;
            &lt;ResourceDictionary Source="/Views/SharedResources.xaml" /&gt;
        &lt;/ResourceDictionary.MergedDictionaries&gt;
    &lt;/ResourceDictionary&gt;
&lt;/src:StartPageViewBase.Resources&gt;
&lt;Grid&gt;
    &lt;ItemsControl ItemsSource="{Binding Path=Documents}" DataContext="{Binding}" Grid.IsSharedSizeScope="True" Margin="5,5,5,5"&gt;
        &lt;ItemsControl.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                &lt;Button Style="{DynamicResource {x:Static ribbon:RibbonStyles.ButtonKey}}" HorizontalContentAlignment="Left"
                        Command="{StaticResource fileSelectedCommand}" CommandParameter="{Binding Path=Location}"&gt;
                    &lt;Grid&gt;
                        &lt;Grid.ColumnDefinitions&gt;
                            &lt;ColumnDefinition Width="Auto" SharedSizeGroup="Name" /&gt;
                            &lt;ColumnDefinition Width="*" /&gt;
                        &lt;/Grid.ColumnDefinitions&gt;
                        &lt;TextBlock Grid.Column="0" Text="{Binding Path=Name}" Margin="0,0,3,0" /&gt;
                        &lt;TextBlock Grid.Column="1" Text="{Binding Path=Location}" ToolTip="{Binding Path=Location}" Margin="0,0,3,0" /&gt;
                    &lt;/Grid&gt;
                &lt;/Button&gt;
            &lt;/DataTemplate&gt;
        &lt;/ItemsControl.ItemTemplate&gt;
    &lt;/ItemsControl&gt;
&lt;/Grid&gt;
</pre>
        <p>
 
</p>
        <p>
The problem that drove me crazy was the fact that originally my command was declared
with a <strong>string</strong> in the generic type, and in the case of a delegate-command
(or a relay-command as it is otherwise known), the generic type defines the type that
the potential argument will be.  The <strong>CommandParameter</strong> argument
shown above is bound to a data context member called<strong> Location</strong>, and
this member is a <strong>URI</strong>, not a <strong>string</strong>.
</p>
        <p>
The simple mistake of having declared <strong>FileSelectedCommand</strong> as <strong>DelegateCommand&lt;string&gt;</strong>,
completely disbled the button to which the command is bound.
</p>
        <p>
Uhhhhhhg!
</p>
        <p>
---------------------
</p>
        <p>
On another topic, I haven’t done a very good job regularly posting the “This Week
In Code” series.  I’m not going to stop doing it, and I promise to try to get
back to making it weekly as in the first four, but I’ve been traveling a lot lately
and could never guarantee where I’m going to be from one week to the next.
</p>
        <p>
 
</p>
        <h3>
          <em>
            <strong>Until next time…</strong>
          </em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=c7216025-62df-41bb-aae4-e2e3e207d311" />
      </body>
      <title>WPF Command Parameter Type Has To Be Exact !</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,c7216025-62df-41bb-aae4-e2e3e207d311.aspx</guid>
      <link>http://www.dotnetdude.com/2010/11/03/WPFCommandParameterTypeHasToBeExact.aspx</link>
      <pubDate>Wed, 03 Nov 2010 23:51:55 GMT</pubDate>
      <description>&lt;p&gt;
Oh boy, this one just drove me insane for over two hours.
&lt;/p&gt;
&lt;p&gt;
First of all, I have a ViewModel that is bound to a user control on a “start page”
of my application which is designed to show a Recent Files list.&amp;nbsp; The displaying
of this list worked just fine.&amp;nbsp; The ViewModel encapsulates a command member whose
execution method is within the ViewModel class itself.
&lt;/p&gt;
&lt;p&gt;
The command is declared and initialized in my view model like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public override void InitializeViewModel()
{
    FileSelectedCommand = new DelegateCommand&amp;lt;Uri&amp;gt;(FileSelectedCommand_Execute);
    base.InitializeViewModel();
}

public DelegateCommand&amp;lt;Uri&amp;gt; FileSelectedCommand { get; protected set; }
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The command’s execution method looks like this, but what it’s doing is not what’s
important here.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;void FileSelectedCommand_Execute(Uri arg)
{
    if (arg != null)
    {
        _RecentDocManager.NotifyDocumentOpened(arg);
        OnFileSelected(new FileLocationEventArgs(arg));
    }
}
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
What is important is the argument that it’s set up to receive.&amp;nbsp; Notice that in
this case, it’s a URI, which is the exact type to which the &lt;strong&gt;CommandParameter&lt;/strong&gt; argument
in my view is bound:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;src:StartPageViewBase.Resources&amp;gt;
    &amp;lt;shared:CommandReference x:Key="fileSelectedCommand" Command="{Binding Path=FileSelectedCommand}" /&amp;gt;
    &amp;lt;ResourceDictionary x:Key="dict1"&amp;gt;
        &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
            &amp;lt;ResourceDictionary Source="/Views/SharedResources.xaml" /&amp;gt;
        &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
    &amp;lt;/ResourceDictionary&amp;gt;
&amp;lt;/src:StartPageViewBase.Resources&amp;gt;
&amp;lt;Grid&amp;gt;
    &amp;lt;ItemsControl ItemsSource="{Binding Path=Documents}" DataContext="{Binding}" Grid.IsSharedSizeScope="True" Margin="5,5,5,5"&amp;gt;
        &amp;lt;ItemsControl.ItemTemplate&amp;gt;
            &amp;lt;DataTemplate&amp;gt;
                &amp;lt;Button Style="{DynamicResource {x:Static ribbon:RibbonStyles.ButtonKey}}" HorizontalContentAlignment="Left"
                        Command="{StaticResource fileSelectedCommand}" CommandParameter="{Binding Path=Location}"&amp;gt;
                    &amp;lt;Grid&amp;gt;
                        &amp;lt;Grid.ColumnDefinitions&amp;gt;
                            &amp;lt;ColumnDefinition Width="Auto" SharedSizeGroup="Name" /&amp;gt;
                            &amp;lt;ColumnDefinition Width="*" /&amp;gt;
                        &amp;lt;/Grid.ColumnDefinitions&amp;gt;
                        &amp;lt;TextBlock Grid.Column="0" Text="{Binding Path=Name}" Margin="0,0,3,0" /&amp;gt;
                        &amp;lt;TextBlock Grid.Column="1" Text="{Binding Path=Location}" ToolTip="{Binding Path=Location}" Margin="0,0,3,0" /&amp;gt;
                    &amp;lt;/Grid&amp;gt;
                &amp;lt;/Button&amp;gt;
            &amp;lt;/DataTemplate&amp;gt;
        &amp;lt;/ItemsControl.ItemTemplate&amp;gt;
    &amp;lt;/ItemsControl&amp;gt;
&amp;lt;/Grid&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The problem that drove me crazy was the fact that originally my command was declared
with a &lt;strong&gt;string&lt;/strong&gt; in the generic type, and in the case of a delegate-command
(or a relay-command as it is otherwise known), the generic type defines the type that
the potential argument will be.&amp;nbsp; The &lt;strong&gt;CommandParameter&lt;/strong&gt; argument
shown above is bound to a data context member called&lt;strong&gt; Location&lt;/strong&gt;, and
this member is a &lt;strong&gt;URI&lt;/strong&gt;, not a &lt;strong&gt;string&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
The simple mistake of having declared &lt;strong&gt;FileSelectedCommand&lt;/strong&gt; as &lt;strong&gt;DelegateCommand&amp;lt;string&amp;gt;&lt;/strong&gt;,
completely disbled the button to which the command is bound.
&lt;/p&gt;
&lt;p&gt;
Uhhhhhhg!
&lt;/p&gt;
&lt;p&gt;
---------------------
&lt;/p&gt;
&lt;p&gt;
On another topic, I haven’t done a very good job regularly posting the “This Week
In Code” series.&amp;nbsp; I’m not going to stop doing it, and I promise to try to get
back to making it weekly as in the first four, but I’ve been traveling a lot lately
and could never guarantee where I’m going to be from one week to the next.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;&lt;strong&gt;Until next time…&lt;/strong&gt;&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=c7216025-62df-41bb-aae4-e2e3e207d311" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,c7216025-62df-41bb-aae4-e2e3e207d311.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
My good buddy, Wally McClure was just featured in an article for “Application Development
Trends” on iPhone development using Mono-Touch.  Wally has been speaking on this
around the country, and I was actually an audience member in CodeStock this year. 
I gotta say, I found the topic informative an intriguing, since I fall into the very
category that he targets, .NET devs with iPhones.
</p>
        <p>
It’s definitely a topic worth talking about since it brings together to really great
platforms.  The article is not a how-to, it’s an interview conducted by Michael
Desmond (isn’t that one of the former Monkees?), but it’s a nice read.
</p>
        <p>
Check out the article at <a href="http://adtmag.com/articles/2010/09/29/monotouch-qa-with-wallace-mcclure.aspx">http://adtmag.com/articles/2010/09/29/monotouch-qa-with-wallace-mcclure.aspx</a>.
</p>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9" />
      </body>
      <title>If you’re a .NET developer and you have an iPhone, you need more Wally in your life</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9.aspx</guid>
      <link>http://www.dotnetdude.com/2010/09/29/IfYoureANETDeveloperAndYouHaveAnIPhoneYouNeedMoreWallyInYourLife.aspx</link>
      <pubDate>Wed, 29 Sep 2010 18:24:59 GMT</pubDate>
      <description>&lt;p&gt;
My good buddy, Wally McClure was just featured in an article for “Application Development
Trends” on iPhone development using Mono-Touch.&amp;nbsp; Wally has been speaking on this
around the country, and I was actually an audience member in CodeStock this year.&amp;nbsp;
I gotta say, I found the topic informative an intriguing, since I fall into the very
category that he targets, .NET devs with iPhones.
&lt;/p&gt;
&lt;p&gt;
It’s definitely a topic worth talking about since it brings together to really great
platforms.&amp;nbsp; The article is not a how-to, it’s an interview conducted by Michael
Desmond (isn’t that one of the former Monkees?), but it’s a nice read.
&lt;/p&gt;
&lt;p&gt;
Check out the article at &lt;a href="http://adtmag.com/articles/2010/09/29/monotouch-qa-with-wallace-mcclure.aspx"&gt;http://adtmag.com/articles/2010/09/29/monotouch-qa-with-wallace-mcclure.aspx&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,13d1a7e7-f2f8-4819-81c5-ab2fc3b561f9.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnetdude.com/Trackback.aspx?guid=ae5a82d3-5df7-4aec-be18-77b8bed522d8</trackback:ping>
      <pingback:server>http://www.dotnetdude.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnetdude.com/PermaLink,guid,ae5a82d3-5df7-4aec-be18-77b8bed522d8.aspx</pingback:target>
      <dc:creator>Miguel A. Castro</dc:creator>
      <wfw:comment>http://www.dotnetdude.com/CommentView,guid,ae5a82d3-5df7-4aec-be18-77b8bed522d8.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnetdude.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ae5a82d3-5df7-4aec-be18-77b8bed522d8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of my latest challenges involved the topic of WPF sizing.  I’m referring
to the manipulation of control widths in relation to their parent widths.  Most
books tell you that this happens automatically, but I’m here to say otherwise gentle
reader.  Now, I am fully prepared to admit that I may have missed something so
if you’re a WPF expert out there and you think there is a better way to do what I’m
going to show you, please respond.  
</p>
        <p>
So here is my situation:
</p>
        <p>
I have a window (user control actually, but then almost everything is in most WPF
applications).  My window defines a grid with two columns, each which will contain
a user control of their own.  It looked something like this:
</p>
        <p>
 
</p>
        <pre class="brush: xml; ruler: false;">&lt;Grid&gt;
    &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width="300" /&gt;
        &lt;ColumnDefinition Width="*" /&gt;
    &lt;/Grid.ColumnDefinitions&gt;
    &lt;src:Control1 Grid.Column="0" x:Name="ctlControl1" DataContext="{Binding Path=Control1ViewModel}" /&gt;
    &lt;src:Control2 Grid.Column="2" x:Name="ctlControl2" /&gt;
&lt;/Grid&gt;
</pre>
        <p>
The user control called <strong>Control1</strong> contains a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listview.aspx" target="_blank">ListView</a> control
which defined an <strong>ItemTemplate</strong> to construct the content structure
of each item.  The effect I wanted was to show the data for each item in read-only
mode and provide an “edit” icon on each item.  Pressing it would convert that
item to editable textboxes.  I got that working fine by providing two Grids inside
my data template, setting one of them invisible, then using commanding on the button
icons to change the view-model state to switch the <a href="http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx" target="_blank">Visibility</a> of
each grid was bound – worked like a charm and is a really nice effect.
</p>
        <p>
My problem was that both the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.aspx" target="_blank">TextBlock</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.aspx" target="_blank">TextBox</a> controls
in each item view sized to its contents, then the widest one became the width of the
actual <strong>ListView</strong> that contained everything.  Originally, the
column that contained this entire user control (defined above) was set to <strong>Auto</strong>,
so of course it would widen to the width of the longest text control.  This totally
sucked.
</p>
        <p>
I added a splitter to the grid in the user control that contained the other two controls
and the results at first were weird.  I took the recommendation of most books
and added the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.gridsplitter.aspx" target="_blank">GridSplitter</a> to
its own column (set to Auto width) at first.  This enabled me to resize the grid
columns but by then, the content user control’s width was already set and it would
not resize along with my resize-drag.  Dragging the splitter to the right, left
the contents of the first column fixed, and dragging to the left basically didn’t
work past the already fixed-width of the first column.  I fixed this by adding
the <strong>GridSplitter</strong> as the last control on the same column as one of
the controls, like this:
</p>
        <p>
 
</p>
        <pre class="brush: xml; ruler: false;">&lt;Grid&gt;
    &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width="300" /&gt;
        &lt;ColumnDefinition Width="*" /&gt;
    &lt;/Grid.ColumnDefinitions&gt;
    &lt;src:Control1Grid.Column="0" x:Name="ctlControl1" DataContext="{Binding Path=Control1ViewModel}" /&gt;
    &lt;GridSplitter ResizeDirection="Columns" Grid.Column="0" Width="3" /&gt;
    &lt;src:Control2 Grid.Column="2" x:Name="ctlControl2" /&gt;
&lt;/Grid&gt;
</pre>
        <p>
 
</p>
        <p>
Now when I drag the splitter, the columns follow along the resize in both directions;
however the <strong>TextBlock</strong> and <strong>TextBox</strong> controls in my <strong>ListView</strong> remain
sized to their contents and would not stretch in either direction.  This still
totally sucked.
</p>
        <p>
After playing around significantly with this, I discovered that the <strong>ListView</strong> itself
was sizing and resizing dynamically as I dragged my splitter so I needed to get the
contents of each item to size similarly.  The solution was to bind the <strong>Width</strong> of
each of my <strong>TextBlock</strong> and <strong>TextBox</strong> items to the width
of the <strong>ListView</strong> in which they were contained.  I gave the <strong>ListView</strong> control
a name (I don’t normally name my controls since most of my work happens in the View-Model
anyway), then set the <strong>Width</strong> property of the contained controls like
this:
</p>
        <p>
 
</p>
        <pre class="brush: xml; ruler: false;">&lt;ListView Name="lvw1" ItemsSource="{Binding}" DataContext="{Binding Path=VuewModelPropertyGoesHere}"&gt;
    &lt;ListView.ItemTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Grid&gt;
                &lt;Grid Visibility="{Binding Path=EditMode, Converter={StaticResource notEditModeVisibilityConverter}, Mode=OneWay}"&gt;
                    &lt;Grid.RowDefinitions&gt;
                        &lt;RowDefinition Height="25" /&gt;
                        &lt;RowDefinition Height="Auto" /&gt;
                        &lt;RowDefinition Height="25" /&gt;
                        &lt;RowDefinition Height="10" /&gt;
                    &lt;/Grid.RowDefinitions&gt;
                    &lt;Grid.ColumnDefinitions&gt;
                        &lt;ColumnDefinition Width="*" /&gt;
                    &lt;/Grid.ColumnDefinitions&gt;
                    &lt;TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=Name}" TextWrapping="Wrap" HorizontalAlignment="Stretch"<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth}" Margin="0,0,5,0" /&gt; &lt;TextBlock
Grid.Row="1" Grid.Column="0" Text="{Binding Path=Description}" TextWrapping="Wrap"
HorizontalAlignment="Stretch" 
<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth}" Margin="0,0,5,0" /&gt; . . .
&lt;/Grid&gt; &lt;Grid Visibility="{Binding Path=EditMode, Converter={StaticResource
editModeVisibilityConverter}, Mode=OneWay}"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition
Height="25" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="*"
/&gt; &lt;RowDefinition Height="10" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt;
&lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBox Grid.Row="0"
Grid.Column="0" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}" 
<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth, Mode=OneWay}" Margin="0,0,5,0"
VerticalAlignment="Center" /&gt; &lt;TextBox Grid.Row="1" Grid.Column="0" Text="{Binding
Path=Description, UpdateSourceTrigger=PropertyChanged}" 
<br />
TextWrapping="Wrap" AcceptsReturn="True" MaxLines="3" MinLines="3" VerticalScrollBarVisibility="Auto"<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth, Mode=OneWay}" Margin="0,0,5,0"
VerticalAlignment="Center" /&gt; </pre>
        <p>
 
</p>
        <p>
This totally fixed my problem… almost.  While the binding worked perfectly, the
look I got left one little detail to be desired.  You see, now the width of the
textboxes as equal to the width of the <strong>ListView</strong>.  This made
their right edge disappear, and no margin and padding setting would fix it.
</p>
        <p>
What I needed to do is set the width of the controls to slightly less than the width
of the <strong>ListView</strong>; 10 pixels less to be exact.  Apparently in
WPF, you either bind or you do not bind; not a combination of the two.  And you
certainly cannot do mathematics in the XAML.  So what to do?
</p>
        <p>
At this point, I had become quite comfortable with the idea of a type-converter so
this is the first thing that sprung into my mind.  I created a type converter
that I could use in this binding.  The job of the type converter would be to
take the incoming width, and rather than convert it to another type, simply adjust
by a certain amount and return that number.  And what amount you ask?  Well,
the type converter gives you a “parameter’ argument than you can fill in the XAML,
so the answer is: any amount I desire.
</p>
        <p>
The end-result worked and looked great.  Here’s the type converter code:
</p>
        <p>
 
</p>
        <pre class="brush: csharp; ruler: false;">public class WidthToParentConverter : IValueConverter
{
    object IValueConverter.Convert(object value, Type targetType, object parameter,
        System.Globalization.CultureInfo culture)
    {
        double width = (double)value;
        double adjustment = Convert.ToDouble(parameter);

        return width + adjustment;
    }

    object IValueConverter.ConvertBack(object value, Type targetType, object parameter,
        System.Globalization.CultureInfo culture)
    {
        double width = (double)value;
        double adjustment = Convert.ToDouble(parameter);

        return width - adjustment;
    }
}
</pre>
        <p>
 
</p>
        <p>
And here’s the adjusted XAML for the textboxes:
</p>
        <p>
 
</p>
        <pre class="brush: xml; ruler: false;">&lt;TextBox Grid.Row="0" Grid.Column="0" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}"<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth, Converter={StaticResource widthToParentConverter},
ConverterParameter=-10, Mode=OneWay}"<br />
Margin="0,0,5,0" VerticalAlignment="Center" /&gt; &lt;TextBox Grid.Row="1" Grid.Column="0"
Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}"<br />
TextWrapping="Wrap" AcceptsReturn="True" MaxLines="3" MinLines="3" VerticalScrollBarVisibility="Auto" 
<br />
Width="{Binding ElementName=lvw1, Path=ActualWidth, Converter={StaticResource widthToParentConverter},
ConverterParameter=-10, Mode=OneWay}" 
<br />
Margin="0,0,5,0" VerticalAlignment="Center" /&gt; </pre>
        <p>
 
</p>
        <p>
 
</p>
        <p>
I struggled with this for a quite a bit, mainly because of inexperience, but now I
know exactly what to do in this situation and I hope sharing it helps some of you
as well.
</p>
        <p>
 
</p>
        <h3>
          <em>Until Next Time…</em>
        </h3>
        <img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=ae5a82d3-5df7-4aec-be18-77b8bed522d8" />
      </body>
      <title>Binding Widths In WPF With A Slight Adjustment</title>
      <guid isPermaLink="false">http://www.dotnetdude.com/PermaLink,guid,ae5a82d3-5df7-4aec-be18-77b8bed522d8.aspx</guid>
      <link>http://www.dotnetdude.com/2010/09/24/BindingWidthsInWPFWithASlightAdjustment.aspx</link>
      <pubDate>Fri, 24 Sep 2010 20:38:46 GMT</pubDate>
      <description>&lt;p&gt;
One of my latest challenges involved the topic of WPF sizing.&amp;nbsp; I’m referring
to the manipulation of control widths in relation to their parent widths.&amp;nbsp; Most
books tell you that this happens automatically, but I’m here to say otherwise gentle
reader.&amp;nbsp; Now, I am fully prepared to admit that I may have missed something so
if you’re a WPF expert out there and you think there is a better way to do what I’m
going to show you, please respond.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
So here is my situation:
&lt;/p&gt;
&lt;p&gt;
I have a window (user control actually, but then almost everything is in most WPF
applications).&amp;nbsp; My window defines a grid with two columns, each which will contain
a user control of their own.&amp;nbsp; It looked something like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml; ruler: false;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;Grid.ColumnDefinitions&amp;gt;
        &amp;lt;ColumnDefinition Width="300" /&amp;gt;
        &amp;lt;ColumnDefinition Width="*" /&amp;gt;
    &amp;lt;/Grid.ColumnDefinitions&amp;gt;
    &amp;lt;src:Control1 Grid.Column="0" x:Name="ctlControl1" DataContext="{Binding Path=Control1ViewModel}" /&amp;gt;
    &amp;lt;src:Control2 Grid.Column="2" x:Name="ctlControl2" /&amp;gt;
&amp;lt;/Grid&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
The user control called &lt;strong&gt;Control1&lt;/strong&gt; contains a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listview.aspx" target="_blank"&gt;ListView&lt;/a&gt; control
which defined an &lt;strong&gt;ItemTemplate&lt;/strong&gt; to construct the content structure
of each item.&amp;nbsp; The effect I wanted was to show the data for each item in read-only
mode and provide an “edit” icon on each item.&amp;nbsp; Pressing it would convert that
item to editable textboxes.&amp;nbsp; I got that working fine by providing two Grids inside
my data template, setting one of them invisible, then using commanding on the button
icons to change the view-model state to switch the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx" target="_blank"&gt;Visibility&lt;/a&gt; of
each grid was bound – worked like a charm and is a really nice effect.
&lt;/p&gt;
&lt;p&gt;
My problem was that both the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.aspx" target="_blank"&gt;TextBlock&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.aspx" target="_blank"&gt;TextBox&lt;/a&gt; controls
in each item view sized to its contents, then the widest one became the width of the
actual &lt;strong&gt;ListView&lt;/strong&gt; that contained everything.&amp;nbsp; Originally, the
column that contained this entire user control (defined above) was set to &lt;strong&gt;Auto&lt;/strong&gt;,
so of course it would widen to the width of the longest text control.&amp;nbsp; This totally
sucked.
&lt;/p&gt;
&lt;p&gt;
I added a splitter to the grid in the user control that contained the other two controls
and the results at first were weird.&amp;nbsp; I took the recommendation of most books
and added the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.gridsplitter.aspx" target="_blank"&gt;GridSplitter&lt;/a&gt; to
its own column (set to Auto width) at first.&amp;nbsp; This enabled me to resize the grid
columns but by then, the content user control’s width was already set and it would
not resize along with my resize-drag.&amp;nbsp; Dragging the splitter to the right, left
the contents of the first column fixed, and dragging to the left basically didn’t
work past the already fixed-width of the first column.&amp;nbsp; I fixed this by adding
the &lt;strong&gt;GridSplitter&lt;/strong&gt; as the last control on the same column as one of
the controls, like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml; ruler: false;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;Grid.ColumnDefinitions&amp;gt;
        &amp;lt;ColumnDefinition Width="300" /&amp;gt;
        &amp;lt;ColumnDefinition Width="*" /&amp;gt;
    &amp;lt;/Grid.ColumnDefinitions&amp;gt;
    &amp;lt;src:Control1Grid.Column="0" x:Name="ctlControl1" DataContext="{Binding Path=Control1ViewModel}" /&amp;gt;
    &amp;lt;GridSplitter ResizeDirection="Columns" Grid.Column="0" Width="3" /&amp;gt;
    &amp;lt;src:Control2 Grid.Column="2" x:Name="ctlControl2" /&amp;gt;
&amp;lt;/Grid&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Now when I drag the splitter, the columns follow along the resize in both directions;
however the &lt;strong&gt;TextBlock&lt;/strong&gt; and &lt;strong&gt;TextBox&lt;/strong&gt; controls in my &lt;strong&gt;ListView&lt;/strong&gt; remain
sized to their contents and would not stretch in either direction.&amp;nbsp; This still
totally sucked.
&lt;/p&gt;
&lt;p&gt;
After playing around significantly with this, I discovered that the &lt;strong&gt;ListView&lt;/strong&gt; itself
was sizing and resizing dynamically as I dragged my splitter so I needed to get the
contents of each item to size similarly.&amp;nbsp; The solution was to bind the &lt;strong&gt;Width&lt;/strong&gt; of
each of my &lt;strong&gt;TextBlock&lt;/strong&gt; and &lt;strong&gt;TextBox&lt;/strong&gt; items to the width
of the &lt;strong&gt;ListView&lt;/strong&gt; in which they were contained.&amp;nbsp; I gave the &lt;strong&gt;ListView&lt;/strong&gt; control
a name (I don’t normally name my controls since most of my work happens in the View-Model
anyway), then set the &lt;strong&gt;Width&lt;/strong&gt; property of the contained controls like
this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml; ruler: false;"&gt;&amp;lt;ListView Name="lvw1" ItemsSource="{Binding}" DataContext="{Binding Path=VuewModelPropertyGoesHere}"&amp;gt;
    &amp;lt;ListView.ItemTemplate&amp;gt;
        &amp;lt;DataTemplate&amp;gt;
            &amp;lt;Grid&amp;gt;
                &amp;lt;Grid Visibility="{Binding Path=EditMode, Converter={StaticResource notEditModeVisibilityConverter}, Mode=OneWay}"&amp;gt;
                    &amp;lt;Grid.RowDefinitions&amp;gt;
                        &amp;lt;RowDefinition Height="25" /&amp;gt;
                        &amp;lt;RowDefinition Height="Auto" /&amp;gt;
                        &amp;lt;RowDefinition Height="25" /&amp;gt;
                        &amp;lt;RowDefinition Height="10" /&amp;gt;
                    &amp;lt;/Grid.RowDefinitions&amp;gt;
                    &amp;lt;Grid.ColumnDefinitions&amp;gt;
                        &amp;lt;ColumnDefinition Width="*" /&amp;gt;
                    &amp;lt;/Grid.ColumnDefinitions&amp;gt;
                    &amp;lt;TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=Name}" TextWrapping="Wrap" HorizontalAlignment="Stretch"&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth}" Margin="0,0,5,0" /&amp;gt; &amp;lt;TextBlock
Grid.Row="1" Grid.Column="0" Text="{Binding Path=Description}" TextWrapping="Wrap"
HorizontalAlignment="Stretch" 
&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth}" Margin="0,0,5,0" /&amp;gt; . . .
&amp;lt;/Grid&amp;gt; &amp;lt;Grid Visibility="{Binding Path=EditMode, Converter={StaticResource
editModeVisibilityConverter}, Mode=OneWay}"&amp;gt; &amp;lt;Grid.RowDefinitions&amp;gt; &amp;lt;RowDefinition
Height="25" /&amp;gt; &amp;lt;RowDefinition Height="Auto" /&amp;gt; &amp;lt;RowDefinition Height="*"
/&amp;gt; &amp;lt;RowDefinition Height="10" /&amp;gt; &amp;lt;/Grid.RowDefinitions&amp;gt; &amp;lt;Grid.ColumnDefinitions&amp;gt;
&amp;lt;ColumnDefinition Width="*" /&amp;gt; &amp;lt;/Grid.ColumnDefinitions&amp;gt; &amp;lt;TextBox Grid.Row="0"
Grid.Column="0" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}" 
&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth, Mode=OneWay}" Margin="0,0,5,0"
VerticalAlignment="Center" /&amp;gt; &amp;lt;TextBox Grid.Row="1" Grid.Column="0" Text="{Binding
Path=Description, UpdateSourceTrigger=PropertyChanged}" 
&lt;br&gt;
TextWrapping="Wrap" AcceptsReturn="True" MaxLines="3" MinLines="3" VerticalScrollBarVisibility="Auto"&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth, Mode=OneWay}" Margin="0,0,5,0"
VerticalAlignment="Center" /&amp;gt; &lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
This totally fixed my problem… almost.&amp;nbsp; While the binding worked perfectly, the
look I got left one little detail to be desired.&amp;nbsp; You see, now the width of the
textboxes as equal to the width of the &lt;strong&gt;ListView&lt;/strong&gt;.&amp;nbsp; This made
their right edge disappear, and no margin and padding setting would fix it.
&lt;/p&gt;
&lt;p&gt;
What I needed to do is set the width of the controls to slightly less than the width
of the &lt;strong&gt;ListView&lt;/strong&gt;; 10 pixels less to be exact.&amp;nbsp; Apparently in
WPF, you either bind or you do not bind; not a combination of the two.&amp;nbsp; And you
certainly cannot do mathematics in the XAML.&amp;nbsp; So what to do?
&lt;/p&gt;
&lt;p&gt;
At this point, I had become quite comfortable with the idea of a type-converter so
this is the first thing that sprung into my mind.&amp;nbsp; I created a type converter
that I could use in this binding.&amp;nbsp; The job of the type converter would be to
take the incoming width, and rather than convert it to another type, simply adjust
by a certain amount and return that number.&amp;nbsp; And what amount you ask?&amp;nbsp; Well,
the type converter gives you a “parameter’ argument than you can fill in the XAML,
so the answer is: any amount I desire.
&lt;/p&gt;
&lt;p&gt;
The end-result worked and looked great.&amp;nbsp; Here’s the type converter code:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: csharp; ruler: false;"&gt;public class WidthToParentConverter : IValueConverter
{
    object IValueConverter.Convert(object value, Type targetType, object parameter,
        System.Globalization.CultureInfo culture)
    {
        double width = (double)value;
        double adjustment = Convert.ToDouble(parameter);

        return width + adjustment;
    }

    object IValueConverter.ConvertBack(object value, Type targetType, object parameter,
        System.Globalization.CultureInfo culture)
    {
        double width = (double)value;
        double adjustment = Convert.ToDouble(parameter);

        return width - adjustment;
    }
}
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
And here’s the adjusted XAML for the textboxes:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class="brush: xml; ruler: false;"&gt;&amp;lt;TextBox Grid.Row="0" Grid.Column="0" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}"&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth, Converter={StaticResource widthToParentConverter},
ConverterParameter=-10, Mode=OneWay}"&lt;br&gt;
Margin="0,0,5,0" VerticalAlignment="Center" /&amp;gt; &amp;lt;TextBox Grid.Row="1" Grid.Column="0"
Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}"&lt;br&gt;
TextWrapping="Wrap" AcceptsReturn="True" MaxLines="3" MinLines="3" VerticalScrollBarVisibility="Auto" 
&lt;br&gt;
Width="{Binding ElementName=lvw1, Path=ActualWidth, Converter={StaticResource widthToParentConverter},
ConverterParameter=-10, Mode=OneWay}" 
&lt;br&gt;
Margin="0,0,5,0" VerticalAlignment="Center" /&amp;gt; &lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I struggled with this for a quite a bit, mainly because of inexperience, but now I
know exactly what to do in this situation and I hope sharing it helps some of you
as well.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Until Next Time…&lt;/em&gt;
&lt;/h3&gt;
&lt;img width="0" height="0" src="http://www.dotnetdude.com/aggbug.ashx?id=ae5a82d3-5df7-4aec-be18-77b8bed522d8" /&gt;</description>
      <comments>http://www.dotnetdude.com/CommentView,guid,ae5a82d3-5df7-4aec-be18-77b8bed522d8.aspx</comments>
      <category>Dev Stuff</category>
      <category>WPF</category>
    </item>
  </channel>
</rss>
