<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Silverlight Slider that snaps to rounded value when dragged</title>
	<atom:link href="http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/feed/" rel="self" type="application/rss+xml" />
	<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/</link>
	<description>Developer Flotsam - random stuff floating around?</description>
	<lastBuildDate>Sat, 04 Feb 2012 09:46:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Hair Loss Blog</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-1729</link>
		<dc:creator><![CDATA[Hair Loss Blog]]></dc:creator>
		<pubDate>Wed, 15 Jun 2011 05:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-1729</guid>
		<description><![CDATA[This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like &#039;Mixview&#039; that let you quickly see related albums, songs, or other users related to what you&#039;re listening to. Clicking on one of those will center on that item, and another set of &quot;neighbors&quot; will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune &quot;Social&quot; is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.]]></description>
		<content:encoded><![CDATA[<p>This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like &#8216;Mixview&#8217; that let you quickly see related albums, songs, or other users related to what you&#8217;re listening to. Clicking on one of those will center on that item, and another set of &#8220;neighbors&#8221; will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune &#8220;Social&#8221; is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhuxin</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-1663</link>
		<dc:creator><![CDATA[dhuxin]]></dc:creator>
		<pubDate>Sat, 09 Apr 2011 13:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-1663</guid>
		<description><![CDATA[public class RounderValueSlider:Slider
    {
        

        protected override void OnValueChanged(double oldValue, double newValue)
        {
            base.OnValueChanged(oldValue, newValue);
            int val = Convert.ToInt32(Math.Round(newValue));
            if (val != newValue) Value = val;
        }
    }
work fine!
and won&#039;t break  data binding]]></description>
		<content:encoded><![CDATA[<p>public class RounderValueSlider:Slider<br />
    {</p>
<p>        protected override void OnValueChanged(double oldValue, double newValue)<br />
        {<br />
            base.OnValueChanged(oldValue, newValue);<br />
            int val = Convert.ToInt32(Math.Round(newValue));<br />
            if (val != newValue) Value = val;<br />
        }<br />
    }<br />
work fine!<br />
and won&#8217;t break  data binding</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nishant</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-1197</link>
		<dc:creator><![CDATA[Nishant]]></dc:creator>
		<pubDate>Thu, 14 Oct 2010 06:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-1197</guid>
		<description><![CDATA[Well guys it seems to be good solution provided by Martin.

I guess for this given problem I tried something and it works perfect for me and i guess it fits perfect in Jordan&#039;s case as well i.e. &quot;Not Breaking any Data Binding&quot;

Well steps are

1. Set &quot;TickFrequency&quot; property = 1
2. Set &quot;isSnapToTickEnabled&quot; property = true (Select check box in Blend)

I hope it must work perfect for you case too :-)

Cheers!
Nishant]]></description>
		<content:encoded><![CDATA[<p>Well guys it seems to be good solution provided by Martin.</p>
<p>I guess for this given problem I tried something and it works perfect for me and i guess it fits perfect in Jordan&#8217;s case as well i.e. &#8220;Not Breaking any Data Binding&#8221;</p>
<p>Well steps are</p>
<p>1. Set &#8220;TickFrequency&#8221; property = 1<br />
2. Set &#8220;isSnapToTickEnabled&#8221; property = true (Select check box in Blend)</p>
<p>I hope it must work perfect for you case too <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Cheers!<br />
Nishant</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-1042</link>
		<dc:creator><![CDATA[Thomas]]></dc:creator>
		<pubDate>Fri, 14 May 2010 13:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-1042</guid>
		<description><![CDATA[Hi,

First of all: nice work, this override works like a charm.
Although i have an issue, because of the override the ValueChanged event is not called anymore. How can I fix this?

Thanks in advance!

Thomas]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>First of all: nice work, this override works like a charm.<br />
Although i have an issue, because of the override the ValueChanged event is not called anymore. How can I fix this?</p>
<p>Thanks in advance!</p>
<p>Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-572</link>
		<dc:creator><![CDATA[Jordan]]></dc:creator>
		<pubDate>Thu, 18 Jun 2009 11:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-572</guid>
		<description><![CDATA[I know!!! too busy!]]></description>
		<content:encoded><![CDATA[<p>I know!!! too busy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asheesh Soni</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-571</link>
		<dc:creator><![CDATA[Asheesh Soni]]></dc:creator>
		<pubDate>Thu, 18 Jun 2009 10:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-571</guid>
		<description><![CDATA[Thanks.

Now where is the post on SL-&gt;JS-&gt;HTML graceful degradation? :-?]]></description>
		<content:encoded><![CDATA[<p>Thanks.</p>
<p>Now where is the post on SL-&gt;JS-&gt;HTML graceful degradation? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-570</link>
		<dc:creator><![CDATA[Jordan]]></dc:creator>
		<pubDate>Thu, 18 Jun 2009 07:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-570</guid>
		<description><![CDATA[Very nice :)]]></description>
		<content:encoded><![CDATA[<p>Very nice <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asheesh Soni</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-569</link>
		<dc:creator><![CDATA[Asheesh Soni]]></dc:creator>
		<pubDate>Thu, 18 Jun 2009 07:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-569</guid>
		<description><![CDATA[http://asheeshsoni.blogspot.com/2009/06/silverlight-slider-jump-value-by.html]]></description>
		<content:encoded><![CDATA[<p><a href="http://asheeshsoni.blogspot.com/2009/06/silverlight-slider-jump-value-by.html" rel="nofollow">http://asheeshsoni.blogspot.com/2009/06/silverlight-slider-jump-value-by.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-561</link>
		<dc:creator><![CDATA[Jordan]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 01:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-561</guid>
		<description><![CDATA[Hey Martin,

Thanks for your input :)

Yes your method works, but doesn&#039;t take a couple if things in to account:

Firstly by setting Slide.Value manually you&#039;ll break any data binding on the Value property -&gt; my designs are usually MVVM, so this isnt a great idea.

Second - if you put a Debug.WriteLine in your value changed handler, you&#039;ll see a non rounded change, then a rounded change - i.e. this method is calling Value twice. (0.951156812339332 then 1)

Third - your method assumes you have access to code behind, which is usually only the case in UserControls, not so much in data templates or CustomControls :)

I normally really hate inhertiting off controls to do something so simple, but unfortunately I was stuck with the restrictions I listed here.

Once again thanks for sharing your thoughts!]]></description>
		<content:encoded><![CDATA[<p>Hey Martin,</p>
<p>Thanks for your input <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Yes your method works, but doesn&#8217;t take a couple if things in to account:</p>
<p>Firstly by setting Slide.Value manually you&#8217;ll break any data binding on the Value property -&gt; my designs are usually MVVM, so this isnt a great idea.</p>
<p>Second &#8211; if you put a Debug.WriteLine in your value changed handler, you&#8217;ll see a non rounded change, then a rounded change &#8211; i.e. this method is calling Value twice. (0.951156812339332 then 1)</p>
<p>Third &#8211; your method assumes you have access to code behind, which is usually only the case in UserControls, not so much in data templates or CustomControls <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I normally really hate inhertiting off controls to do something so simple, but unfortunately I was stuck with the restrictions I listed here.</p>
<p>Once again thanks for sharing your thoughts!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Hägerås</title>
		<link>http://jakkaj.wordpress.com/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/#comment-560</link>
		<dc:creator><![CDATA[Martin Hägerås]]></dc:creator>
		<pubDate>Fri, 05 Jun 2009 09:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.webjak.net/?p=295#comment-560</guid>
		<description><![CDATA[I just did this in the ValueChanged handler:
////
void Slider3_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
{
    Slider3.Value = Math.Round(e.NewValue);
}
////

Seems to work fine :)]]></description>
		<content:encoded><![CDATA[<p>I just did this in the ValueChanged handler:<br />
////<br />
void Slider3_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)<br />
{<br />
    Slider3.Value = Math.Round(e.NewValue);<br />
}<br />
////</p>
<p>Seems to work fine <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

