<?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 : NHibernate, Animation</title><link>http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHibernate/Animation/default.aspx</link><description>Tags: NHibernate, Animation</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><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></channel></rss>