<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>.NET &amp; Funky Fresh : WPF, NHibernate</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/NHibernate/default.aspx</link><description>Tags: WPF, NHibernate</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Porting NHProf from WPF to Silverlight – Day 8</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/09/porting-nhprof-from-wpf-to-silverlight-day-8.aspx</link><pubDate>Fri, 09 Apr 2010 20:19:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56877</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56877</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/09/porting-nhprof-from-wpf-to-silverlight-day-8.aspx#comments</comments><description>&lt;p&gt;Day eight* of the port and I was so happy not to discover any new issues. At this point I have almost all the major UI pieces in place.&amp;nbsp; You can now see what you would normally during typical profiler usage.&amp;nbsp; There&amp;rsquo;s still a lot of work to be done&amp;hellip;probably much more than has been done so far. I still have a few big pieces such as query results and query plans. I also have to re-enable multi-selection of sessions and statements because the mechanism we were using in WPF isn&amp;rsquo;t going to work exactly the same for Silverlight. We&amp;rsquo;ve got to rebuild all our control templates and styles.&amp;nbsp; None of those will port. I have to add context menus back in and hook up the help system too.&amp;nbsp; There are a few other smaller things like that to look into. There are plenty of other issues to solve, but everything in its own time :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay8_5F00_7857CB08.jpg"&gt;&lt;img height="785" width="1040" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay8_5F00_thumb_5F00_411143CD.jpg" alt="NHProf Day 8" border="0" title="NHProf Day 8" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;*I&amp;rsquo;m not actually working full eight hour days on this project. I usually end up spending about 4-5 hours per day on average.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56877" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Control+Templates/default.aspx">Control Templates</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>Porting NHProf from WPF to Silverlight – Day 7</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/06/porting-nhprof-from-wpf-to-silverlight-day-7.aspx</link><pubDate>Wed, 07 Apr 2010 02:21:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56774</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56774</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/06/porting-nhprof-from-wpf-to-silverlight-day-7.aspx#comments</comments><description>&lt;p&gt;Today I worked on statements.&amp;nbsp; They flow pretty naturally out of the sessions functionality.&amp;nbsp; I still have a lot of work ahead of me, so fortunately I only found two new issues today.&amp;nbsp; I was able to rework Xaml in both cases fairly easily.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Binding in it&amp;rsquo;s Element form is not allowed.&amp;nbsp; Fortunately, I was able to rework it as a markup extension.&lt;/li&gt;
&lt;li&gt;ContentControl.ContentStringFormat is missing. I was able to use the StringFormat built into the BindingExtension instead.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Screenshot is below.&amp;nbsp; Aside from the hideous styles&amp;hellip;it&amp;rsquo;s actually &lt;a href="http://nhprof.com/"&gt;starting to resemble itself&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay7_5F00_55BB9924.jpg"&gt;&lt;img height="829" width="1104" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay7_5F00_thumb_5F00_506CB273.jpg" alt="NHProf Day 7" border="0" title="NHProf Day 7" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56774" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>Porting NHProf from WPF to Silverlight – Day 6</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/05/porting-nhprof-from-wpf-to-silverlight-day-6.aspx</link><pubDate>Mon, 05 Apr 2010 21:44:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56743</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56743</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/05/porting-nhprof-from-wpf-to-silverlight-day-6.aspx#comments</comments><description>&lt;p&gt;I started working on the most complicated part of the UI: Sessions. There are a lot of different view models and views related to this part. Fortunately, by now, I think I have found most of the issues. But I&amp;rsquo;m still encountering a few new issues here on day six. Below is the customary screenshot and issue list.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay6_5F00_12B943FD.jpg"&gt;&lt;img height="758" width="1004" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay6_5F00_thumb_5F00_4DA076C6.jpg" alt="NHProf Day 6" border="0" title="NHProf Day 6" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Styles don&amp;rsquo;t have Resources. We are probably going to have to re-write all of our styles and control template. So, our new solution will take this into account.&lt;/li&gt;
&lt;li&gt;ControlTemplate cannot have triggers.&amp;nbsp; See above.&lt;/li&gt;
&lt;li&gt;ControlTemplate cannot have resources. See above.&lt;/li&gt;
&lt;li&gt;Uri is missing PathAndQuery &amp;ndash; I implemented this manually by combinding AbsoluteUri and QueryString with a &amp;lsquo;?&amp;rsquo; in between.&lt;/li&gt;
&lt;li&gt;MultiBinding is missing. We are going to do some major rework on that view unfortunately. I&amp;rsquo;ll try and provide more details later. Skipped it for now&amp;hellip;&lt;/li&gt;
&lt;li&gt;No ReaderWriterLockSlim. This was surprising. I really wasn&amp;rsquo;t sure what to do, so I used a standard lock for now.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56743" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Control+Templates/default.aspx">Control Templates</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>Porting NHProf from WPF to Silverlight – Day 5</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/02/porting-nhprof-from-wpf-to-silverlight-day-5.aspx</link><pubDate>Fri, 02 Apr 2010 16:31:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56534</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56534</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/02/porting-nhprof-from-wpf-to-silverlight-day-5.aspx#comments</comments><description>&lt;p&gt;Well, I&amp;rsquo;m pleased to say that on Wednesday I only encountered one new* issue during the port.&amp;nbsp; ListBox does not support grouping.&amp;nbsp; One neat thing in WPF is that all the items controls supported grouping.&amp;nbsp; One of the reports we had was a set of master/details grids where the master was a grouped ListBox. Needless to say, this entire report had to be redesigned to work around this issue. Truth be told, I never really liked the way that report was set up. As a solution I decided to use the Silverlight DataGrid with two levels of grouping. That issue aside, it was pretty quick work to port all the reports.&amp;nbsp; As part of the process, I made the reports mechanism a little easier to maintain. Basically, anything that implements IReport will appear in the report list, will be added to the reports menu and will automatically have its view bound appropriately.&amp;nbsp; Yay for IoC and Caliburn!&amp;nbsp; Here&amp;rsquo;s a screenshot:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay5_5F00_33E94A78.jpg"&gt;&lt;img height="715" width="947" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay5_5F00_thumb_5F00_03C1FFB5.jpg" alt="NHProf Day 5" border="0" title="NHProf Day 5" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*Just as a reminder: When I say &amp;ldquo;new&amp;rdquo; issues I don&amp;rsquo;t want to insinuate that it is the &amp;ldquo;only&amp;rdquo; issue I encountered while working. I have encountered dozens of issues every day. But I am only recording here issues that I find that I haven&amp;rsquo;t previously encountered on this project.&amp;nbsp; Trying to track every &amp;ldquo;instance&amp;rdquo; of an issue would be unmanageable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56534" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>Porting NHProf from WPF to Silverlight – Day 4</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/01/porting-nhprof-from-wpf-to-silverlight-day-4.aspx</link><pubDate>Thu, 01 Apr 2010 18:36:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56450</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56450</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/04/01/porting-nhprof-from-wpf-to-silverlight-day-4.aspx#comments</comments><description>&lt;p&gt;On Tuesday I spent a decent amount of time fleshing out the last remaining features under the Options menu. I then did some general reorganization to the project structure. Along with the port to Silverlight, I&amp;rsquo;ve been upgrading the application to use Caliburn 2.0 which is working out exceedingly well :) In fact, some of Caliburn&amp;rsquo;s features are making it very easy to work around the differences between the WPF and Silverlight platforms. After the reorganization, I decided I would start porting over the reports.&amp;nbsp; As has been my pattern, below is a screenshot and the list of *new* issues I encountered. I&amp;rsquo;m really glad there weren&amp;rsquo;t as many as on Monday&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay4_5F00_7D40096B.jpg"&gt;&lt;img height="650" width="880" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay4_5F00_thumb_5F00_1F2B6BF0.jpg" alt="NHProf Day 4" border="0" title="NHProf Day 4" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;UpdateSourceTrigger=PropertyChanged is missing.&amp;nbsp; There are workarounds which wire for events and manually update the bindings. I used Caliurn 2.0&amp;rsquo;s C over C binding to do this automatically :)&lt;/li&gt;
&lt;li&gt;RelativeSource FindAncestor is missing. Fortunately, I replaced our homegrown grid with the Silverlight DataGrid and was able to eliminate the need for this in this scenario.&lt;/li&gt;
&lt;li&gt;Hyperlink.Tag is is missing. Strange isn&amp;rsquo;t it.&amp;nbsp; I reworked the code to use a HyperlinkButton.&lt;/li&gt;
&lt;li&gt;Binding.StringFormat syntax is different. In WPF, you escape like this Text=&amp;quot;{Binding AverageStatementsPerSession, StringFormat={}{0:0.#},FallbackValue=0}&amp;quot;&amp;nbsp; but that causes a compile-time error in Silverlight.&amp;nbsp; What is worse is that it doesn&amp;rsquo;t tell you where. It just complains that there is something wrong with a markup extensions somewhere in your Xaml. I fixed it with the following change&amp;nbsp; Text=&amp;quot;{Binding AverageStatementsPerSession, StringFormat=\{0:0.#\},FallbackValue=0}&amp;quot;&lt;/li&gt;
&lt;li&gt;GridSplitter is missing ResizeBehavior and ResizeDirection.&amp;nbsp; Fortunately, it seams to work pretty well without them. I have a couple of issues with this that I still need to look into though.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56450" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Control+Templates/default.aspx">Control Templates</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>Porting NHProf from WPF to Silverlight - Day 3</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2010/03/31/porting-nhprof-from-wpf-to-silverlight-day-3.aspx</link><pubDate>Wed, 31 Mar 2010 13:58:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56354</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=56354</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2010/03/31/porting-nhprof-from-wpf-to-silverlight-day-3.aspx#comments</comments><description>&lt;p&gt;On Monday I spent a good four hours working on the port. I decided to flesh out the functionality of the Main Menu. &lt;a href="http://devlicio.us/blogs/rob_eisenberg/archive/2010/03/29/porting-nhprof-from-wpf-to-silverlight-day-2.aspx"&gt;As I mentioned before&lt;/a&gt;, none of the menu controls available support commanding. Fortunately, &lt;a href="http://caliburn.codeplex.com/"&gt;Caliburn&lt;/a&gt; has its own mechanism which is much richer than what you get out of the box anyways. So, I began hooking this up, fleshing out the appropriate commands and implementing the various features of the application related to them. This approach actually brought me in touch with a very wide range of the application&amp;rsquo;s features. As a result, I ended up hitting a lot of issues. I calculated, that on average, I was hitting a *new* API issue (one I hadn&amp;rsquo;t seen previously on this project) every ten minutes for the entire four hour period. That was frustrating to say the least. Below is a (hideous) screenshot and a list of the issues I hit.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay3_5F00_0A10ECDC.jpg"&gt;&lt;img height="686" width="898" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/NHProfDay3_5F00_thumb_5F00_1BF0115A.jpg" alt="NHProf Day 3" border="0" title="NHProf Day 3" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Style.Triggers are not supported. Ultimately this means we are going to have to refactor a lot of styles. Temporary fix to get things running was to comment out the triggers ;(&lt;/li&gt;
&lt;li&gt;DataTrigger not supported either. We&amp;rsquo;ll probably end up refactoring to VSM. Unfortunately, many of our DataTriggers are in Styles&amp;hellip;Fixing this is going to be interesting.&lt;/li&gt;
&lt;li&gt;Custom Markup Extensions are &lt;em&gt;still &lt;/em&gt;not supported in SL4, even after they completely re-wrote their Xaml parser from the ground up to support greater extensibility. My particular scenario was easy to work around by creating a custom IValueConverter. Another reasonable solution might be to create custom attached properties.&lt;/li&gt;
&lt;li&gt;Lack of Command Support on Menu controls &amp;ndash; This is not a problem with SL4 (except that it doesn&amp;rsquo;t have any menu controls), but is an issue with the current 3rd party controls. As I mentioned above, Caliburn made this easy enough to work around.&lt;/li&gt;
&lt;li&gt;OpenFileDialog is missing CheckFileExists, Title, FileName and RestoreDirectory &amp;ndash; We can work around all of this. The major consequence is that the user&amp;rsquo;s experience with the OpenFileDialog will be degraded.&lt;/li&gt;
&lt;li&gt;Missing Timeline.DesiredFrameRate &amp;ndash; Apparently you can&amp;rsquo;t control animation frame rate in Silverlight. I don&amp;rsquo;t think this will be a major issue.&lt;/li&gt;
&lt;li&gt;The following simple storyboard scenario does not work.&amp;nbsp; There&amp;rsquo;s seams to be a problem setting Storyboards with StaticResource. I used a bit of code-behind to start the animation. There&amp;rsquo;s probably a better way. Anyone have an idea?&lt;/li&gt;
&amp;lt;UserControl.Triggers&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EventTrigger RoutedEvent=&amp;quot;FrameworkElement.Loaded&amp;quot;&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;BeginStoryboard Storyboard=&amp;quot;{StaticResource RhinoCharging}&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/EventTrigger&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/UserControl.Triggers&amp;gt;
&lt;li&gt;SaveFileDialog missing Title and FileName &amp;ndash; Again, this can be worked around. Mostly it involves a degraded user experience.&lt;/li&gt;
&lt;li&gt;Process.Start is missing &amp;ndash; There was talk of getting something like this into SL4.&amp;nbsp; It would have been nice. We need it to open default apps for certain file types on the OS. We&amp;rsquo;ll either do without this or push it to our backend (which is not Silverlight).&lt;/li&gt;
&lt;li&gt;Enum.GetValues is missing!&amp;nbsp; I found this nice workaround:&amp;nbsp; &lt;a href="http://www.dolittle.com/blogs/einar/archive/2008/01/13/missing-enum-getvalues-when-doing-silverlight-for-instance.aspx"&gt;http://www.dolittle.com/blogs/einar/archive/2008/01/13/missing-enum-getvalues-when-doing-silverlight-for-instance.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;File.WriteAllText is internal. It would have been nice to have this, but we can work around it using Streams, etc.&lt;/li&gt;
&lt;li&gt;Missing SystemParameters.PrimaryScreenHeight and SystemParameters.PrimaryScreenWidth.&amp;nbsp; We&amp;rsquo;ll just have to do without&amp;hellip;&lt;/li&gt;
&lt;li&gt;Missing Serializable and BinaryFormatter.&amp;nbsp; This is a &lt;em&gt;real&lt;/em&gt; pain. Many people have asked for this since SL2, but the SL team hasn&amp;rsquo;t shown any interest in providing this. We are going to have re-write our user settings mechanism.&lt;/li&gt;
&lt;li&gt;Missing Button.IsDefault and Button.IsCancel. This can be worked around. It means adding custom keyboard wire-ups for modal dialogs. Yuck.&lt;/li&gt;
&lt;li&gt;No Label control &amp;ndash; Now that we have ElementName binding why don&amp;rsquo;t we have a decent label control with Target and ActivatorKey? In the mean time I am using a TextBox.&amp;nbsp; We&amp;rsquo;ll probably have to fix this with a custom control.&lt;/li&gt;
&lt;li&gt;Bindings on DPs don&amp;rsquo;t default to TwoWay where appropriate. This is mostly an annoyance.&lt;/li&gt;
&lt;li&gt;No ValueConversionAttribute to decorate value converters with. Not a big issue. But you need to remove it before you can compile.&lt;/li&gt;
&lt;li&gt;Missing Visibility.Hidden. Again, not a big issue. But, you will need to rework code that uses this to use Opacity and IsHitTestVisible.&lt;/li&gt;
&lt;li&gt;Missing DependencyPropertyKey. &amp;ndash; We had a custom control that required this. We will have to re-write this control.&lt;/li&gt;
&lt;li&gt;Missing FrameworkPropertyMetadata. &amp;ndash; Same as above.&lt;/li&gt;
&lt;li&gt;DependencyProperty is missing OverrideMetadata &amp;ndash; Same as above.&lt;/li&gt;
&lt;li&gt;TextBox is missing MinLines and MaxLines &amp;ndash; We&amp;rsquo;ll manage without this by hardcoding height in pixels (yuck!)&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56354" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Animation/default.aspx">Animation</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category></item><item><title>NH Prof Public Beta</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/2009/01/02/nh-prof-public-beta.aspx</link><pubDate>Fri, 02 Jan 2009 16:01:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43584</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/rob_eisenberg/rsscomments.aspx?PostID=43584</wfw:commentRss><comments>http://devlicio.us/blogs/rob_eisenberg/archive/2009/01/02/nh-prof-public-beta.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://devlicio.us/blogs/christopher_bennage/default.aspx"&gt;Christoper &lt;/a&gt;and I have had the privelage of helping &lt;a href="http://ayende.com/Blog/archive/2009/01/02/nh-prof-is-in-public-beta.aspx"&gt;Ayende &lt;/a&gt;to build the UI for his NHibernate Profiler over the last couple months.&amp;nbsp; Yesterday evening he released the public beta with a 30 day trial version.&amp;nbsp; If you are using NHibernate, get over to &lt;a href="http://nhprof.com/"&gt;the product site&lt;/a&gt; and &lt;a href="http://nhprof.com/Download"&gt;download the beta&lt;/a&gt;.&amp;nbsp; This is going to be an invaluable tool for developers using NHibernate and you can get it at a special price if you purchase during the beta period.&lt;/p&gt;&lt;p&gt;As a developer on this project, I had the unique opportunity to watch &lt;a href="http://ayende.com/Blog/Default.aspx"&gt;a master&lt;/a&gt; at his craft.&amp;nbsp; The architecture of the product is clean and Ayende has managed to jam pack this version with a ton of NHibernate smarts.&amp;nbsp; Just working on it, I gained a deeper understanding of the types of problems one can run into while using an ORM.&amp;nbsp; I would not want to do another project without it.&lt;/p&gt;&lt;p&gt;Another exciting aspect of this application is that we are using the latest version of &lt;a href="http://www.codeplex.com/caliburn"&gt;Caliburn &lt;/a&gt;in the UI architecture.&amp;nbsp; Generally speaking, the UI architecture is composed of a very rich Presentation Model (MVVM) with a splash of MVP for good measure.&amp;nbsp; There is almost no code-behind in the views.&amp;nbsp; All communication is handled by Caliburn&amp;#39;s &lt;a href="http://www.codeplex.com/caliburn/Wiki/View.aspx?title=Table%20Of%20Contents"&gt;action message&lt;/a&gt; mechanism.&amp;nbsp; We were also able to use Caliburn&amp;#39;s new &lt;a href="http://www.codeplex.com/caliburn/Wiki/View.aspx?title=Table%20Of%20Contents"&gt;testability features&lt;/a&gt; to cover all our views with data binding validation tests and do basic property change notification testing.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=43584" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/default.aspx">NHibernate</category></item></channel></rss>