tag:blogger.com,1999:blog-6822536077160579260.post6624295921423851482..comments2023-06-05T14:25:52.227+01:00Comments on Sound Code: Modular WPF Screencast Part 3Anonymoushttp://www.blogger.com/profile/17900587357903273800noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6822536077160579260.post-13203668728334734012013-04-18T20:59:01.246+01:002013-04-18T20:59:01.246+01:00I've just finished watching the 3 parts and I ...I've just finished watching the 3 parts and I absolutely loved it. By far the most comprehensive and pragmatic MVVM tutorial I've seen so far...Great work!Sebisebonoreply@blogger.comtag:blogger.com,1999:blog-6822536077160579260.post-57098645695812025432012-03-11T20:07:51.243+00:002012-03-11T20:07:51.243+00:00Oh that notifypropertyweaver looks interesting. I ...Oh that notifypropertyweaver looks interesting. I will look into that too, since the problem with my technique is that you lose some performance since it needs to do the expression stuff while the string one is just passing the string.Rutixhttps://www.blogger.com/profile/16953963273586259428noreply@blogger.comtag:blogger.com,1999:blog-6822536077160579260.post-19254623125910577952012-03-04T15:56:31.728+00:002012-03-04T15:56:31.728+00:00thanks Rutix, that's an intersting technique. ...thanks Rutix, that's an intersting technique. Recently I've been experimenting with <a href="http://code.google.com/p/notifypropertyweaver/" rel="nofollow">notifypropertyweaver</a> which is another way to get rid of magic strings.Anonymoushttps://www.blogger.com/profile/17900587357903273800noreply@blogger.comtag:blogger.com,1999:blog-6822536077160579260.post-77048353941816312642012-03-04T15:53:06.628+00:002012-03-04T15:53:06.628+00:00Thanks m8! Was waiting for part 3 ^_^.
One improve...Thanks m8! Was waiting for part 3 ^_^.<br />One improvement I can say is that you have magic string when using the RaisePropertyChanged .<br /><br />You use something like this:<br /><br /> public class PropertyOf<br /> {<br /> public static string Resolve(Expression> expression )<br /> {<br /> Expression candidate = null;<br /><br /> if (expression.Body is UnaryExpression)<br /> candidate = (expression.Body as UnaryExpression).Operand;<br /><br /> if (expression.Body is MemberExpression)<br /> candidate = expression.Body;<br /><br /> return (candidate as MemberExpression).Member.Name;<br /> }<br /> }<br /><br />And then call it like this:<br /><br />RaisePropertyChanged(PropertyOf.Resolve(x => x.UserInterface));<br /><br />That would remove the magic strings :).Rutixhttps://www.blogger.com/profile/16953963273586259428noreply@blogger.com