<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Using an Attached DependencyProperty to Implement Pixel Snapping as an Attached Behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx</link><description>In a previous post , I introduced the Snapper element, which is a UserControl subclass that snaps its Content to an integer pixel. Now I'll show how to implement snapping as an attached behavior using a custom attached DependencyProperty. To use the Snapper</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Silverlight Cream for June 23, 2008 -- #307</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8644588</link><pubDate>Tue, 24 Jun 2008 03:53:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8644588</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;Rob Houweling with a Sketch Application (2 parts), Martin Mihaylov continuing with Shapes, Karen Corby&lt;/p&gt;
</description></item><item><title>re: Using an Attached DependencyProperty to Implement Pixel Snapping as an Attached Behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8648354</link><pubDate>Tue, 24 Jun 2008 21:38:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8648354</guid><dc:creator>TWiStErRob</dc:creator><description>&lt;p&gt;You've refactored the dependecy property's explaining code, but the description after was not refactored: DPExample.Count was written instead of DPExample.Distance&lt;/p&gt;
</description></item><item><title>re: Using an Attached DependencyProperty to Implement Pixel Snapping as an Attached Behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8648390</link><pubDate>Tue, 24 Jun 2008 21:48:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8648390</guid><dc:creator>Dave Relyea</dc:creator><description>&lt;p&gt;Hey, thanks, TWiStErRob. Corrected.&lt;/p&gt;
</description></item><item><title>Great example of an attached behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8764483</link><pubDate>Tue, 22 Jul 2008 20:27:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8764483</guid><dc:creator>Tales from the Smart Client</dc:creator><description>&lt;p&gt;From Dave Relyea's blog, Pixel Snapping in Silverlight as an attached behavior: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.asp"&gt;http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.asp&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Great example of an attached behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8764638</link><pubDate>Tue, 22 Jul 2008 21:49:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8764638</guid><dc:creator>Sparkle bloggers</dc:creator><description>&lt;p&gt;From Dave Relyea's blog, Pixel Snapping in Silverlight as an attached behavior: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.asp"&gt;http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.asp&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Using an Attached DependencyProperty to Implement Pixel Snapping as an Attached Behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8764800</link><pubDate>Tue, 22 Jul 2008 23:32:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8764800</guid><dc:creator>dimkaz</dc:creator><description>&lt;p&gt;Nice sample, but don't use IsLive property on the WeakReference it's evil ;)&lt;/p&gt;
&lt;p&gt;Between your call to .IsLive and .Target the GC could have collected the object and exception will be raised&lt;/p&gt;</description></item><item><title>re: Using an Attached DependencyProperty to Implement Pixel Snapping as an Attached Behavior</title><link>http://blogs.msdn.com/devdave/archive/2008/06/22/Using-an-Attached-DependencyProperty-to-Implement-Pixel-Snapping-as-an-Attached-Behavior.aspx#8843577</link><pubDate>Fri, 08 Aug 2008 17:25:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8843577</guid><dc:creator>juliandominguez</dc:creator><description>&lt;p&gt;Hi, good to see that attached behaviors are picking up... I find them very useful, and this is a very nice sample. I wanted to share an example of using attached behaviors in Silverlight to emulate the ICommand interface behavior present in WPF.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.southworks.net/jdominguez/2008/08/icommand-for-silverlight-with-attached-behaviors/"&gt;http://blogs.southworks.net/jdominguez/2008/08/icommand-for-silverlight-with-attached-behaviors/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You may find it useful, as the concepts are exactly the same,&lt;/p&gt;
&lt;p&gt;Julian &lt;/p&gt;</description></item></channel></rss>