<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://azurecoding.net/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>Silverlight 2 XAML Binding and Custom / Core Dependency Properties</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx</link><description>Lately, I have been working in Silverlight 2 quite a bit. I have been infused with inspiration from the Chicago PhizzPop Design Challenge . I&amp;#39;m waiting for the pictures and vids from a couple people to be served. I will be linking them into the blog</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Jason Kenny</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx#174</link><pubDate>Fri, 16 Jan 2009 17:43:40 GMT</pubDate><guid isPermaLink="false">6e97e1e3-dc93-4c0d-b73f-e698f7d56013:174</guid><dc:creator>jason kenny</dc:creator><description>&lt;p&gt;Interesting, but usual =)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://azurecoding.net/aggbug.aspx?PostID=174" width="1" height="1"&gt;</description></item><item><title>2008 November 25 - Links for today &amp;laquo; My (almost) Daily Links</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx#67</link><pubDate>Tue, 25 Nov 2008 09:33:32 GMT</pubDate><guid isPermaLink="false">6e97e1e3-dc93-4c0d-b73f-e698f7d56013:67</guid><dc:creator>2008 November 25 - Links for today « My (almost) Daily Links</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;2008 November 25 - Links for today &amp;laquo; My (almost) Daily Links&lt;/p&gt;
&lt;img src="http://azurecoding.net/aggbug.aspx?PostID=67" width="1" height="1"&gt;</description></item><item><title>Silverlight Cream for November 24, 2008 -- #437</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx#62</link><pubDate>Mon, 24 Nov 2008 16:06:03 GMT</pubDate><guid isPermaLink="false">6e97e1e3-dc93-4c0d-b73f-e698f7d56013:62</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;In this issue: Hannes Preishuber, David Justice, Dan Wahlin, Terence Tsang, and Chris Carper. From SilverlightCream&lt;/p&gt;
&lt;img src="http://azurecoding.net/aggbug.aspx?PostID=62" width="1" height="1"&gt;</description></item><item><title>re: Silverlight 2 XAML Binding and Custom / Core Dependency Properties</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx#59</link><pubDate>Mon, 24 Nov 2008 05:58:14 GMT</pubDate><guid isPermaLink="false">6e97e1e3-dc93-4c0d-b73f-e698f7d56013:59</guid><dc:creator>Justin-Josef Angel</dc:creator><description>&lt;p&gt;Hi David, I&amp;#39;ll try to go easy on you because I like you personally :)&lt;/p&gt;
&lt;p&gt;However, just for the sake of anyone reading this - what you said is completely wrong.&lt;/p&gt;
&lt;p&gt;Still loving you David, but you missed this one big time. &lt;/p&gt;
&lt;p&gt;The only thing that doesn&amp;#39;t get called in this binding is the custom CLR property Radius Setter. However, you still get this nifty callback method which is the *only* thing you should use for custom DP change notifications. &lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how you *should* have used the custom DP change notifications: &lt;/p&gt;
&lt;p&gt;(pretty &amp;amp; readable version at &lt;a rel="nofollow" target="_new" href="http://pastebin.com/m62b2000b"&gt;http://pastebin.com/m62b2000b&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class GlassButton : Button&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static readonly DependencyProperty _radiusProperty = DependencyProperty.Register(&amp;quot;Radius&amp;quot;, typeof(double),&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;typeof(GlassButton), new PropertyMetadata(RadiusCallBack));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private static void RadiusCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GlassButton sender = (GlassButton) d;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int value = Convert.ToInt32(e.NewValue);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (value &amp;gt; 0)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sender.RenderTransform = new ScaleTransform { ScaleX = value / 26, ScaleY = value / 26 };&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public double Radius&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return (double)GetValue(_radiusProperty); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set { this.SetValue(_radiusProperty, value); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;-- Justin&lt;/p&gt;
&lt;p&gt;(remember, it&amp;#39;s all from love :))&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://azurecoding.net/aggbug.aspx?PostID=59" width="1" height="1"&gt;</description></item><item><title>Silverlight 2 XAML Binding and Custom / Core Dependency Properties</title><link>http://azurecoding.net/blogs/icbtw/archive/2008/11/23/silverlight-2-xaml-binding-and-custom-core-dependency-properties.aspx#58</link><pubDate>Sun, 23 Nov 2008 19:06:41 GMT</pubDate><guid isPermaLink="false">6e97e1e3-dc93-4c0d-b73f-e698f7d56013:58</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You&amp;#39;ve been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
&lt;img src="http://azurecoding.net/aggbug.aspx?PostID=58" width="1" height="1"&gt;</description></item></channel></rss>