<?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/"
		>
<channel>
	<title>Comments on: Exposing and Binding to a Silverlight ScrollViewer’s Scrollbars</title>
	<atom:link href="http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/</link>
	<description>Colin Eberhardt&#039;s Adventures in .NET</description>
	<lastBuildDate>Thu, 09 Feb 2012 03:02:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Andrew</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-95715</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 26 Jan 2012 16:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-95715</guid>
		<description>This helped me out a bunch; many thanks!

Instead of attaching to the ScrollBar&#039;s ValueChanged event, the following seems to work, but only if the client&#039;s browser has the Silverlight 5 plugin.

BindingOperations.SetBinding(scroll, ScrollBar.ValueProperty,
	new Binding
	{
		Path = new PropertyPath(ScrollViewerBinding.VerticalOffsetProperty),
		Source = scrollViewer,
		Mode = BindingMode.TwoWay
	});

Interestingly, I&#039;m actually working on a Silverlight 4 app (my company isn&#039;t ready to move to SL5 yet), but this code still works if the client&#039;s browser has SL5.</description>
		<content:encoded><![CDATA[<p>This helped me out a bunch; many thanks!</p>
<p>Instead of attaching to the ScrollBar&#8217;s ValueChanged event, the following seems to work, but only if the client&#8217;s browser has the Silverlight 5 plugin.</p>
<p>BindingOperations.SetBinding(scroll, ScrollBar.ValueProperty,<br />
	new Binding<br />
	{<br />
		Path = new PropertyPath(ScrollViewerBinding.VerticalOffsetProperty),<br />
		Source = scrollViewer,<br />
		Mode = BindingMode.TwoWay<br />
	});</p>
<p>Interestingly, I&#8217;m actually working on a Silverlight 4 app (my company isn&#8217;t ready to move to SL5 yet), but this code still works if the client&#8217;s browser has SL5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zero Gravity Chimp</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-95366</link>
		<dc:creator>Zero Gravity Chimp</dc:creator>
		<pubDate>Thu, 10 Nov 2011 02:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-95366</guid>
		<description>Have you tried -1.0 since this will denote that it is a type Double. works on mine.</description>
		<content:encoded><![CDATA[<p>Have you tried -1.0 since this will denote that it is a type Double. works on mine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kostkac</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-71241</link>
		<dc:creator>Kostkac</dc:creator>
		<pubDate>Thu, 11 Aug 2011 13:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-71241</guid>
		<description>hey Guys, this is great stuff.

sadly to say, it doesnt work for me. Im getting error

The attachable property &#039;HorizontalOffset&#039; was not found in type &#039;ScrollViewerBinding&#039;. [Line: 254 Position: 55]

in InitializeComponent(); method.

this is my implementation - preaty same. 

utils:ScrollViewerBinding.HorizontalOffset=&quot;{Binding YPosition, Mode=TwoWay}&quot; inside ScrollViewer tag

I just dont know what Im doing wring.. Can anybody help me out?</description>
		<content:encoded><![CDATA[<p>hey Guys, this is great stuff.</p>
<p>sadly to say, it doesnt work for me. Im getting error</p>
<p>The attachable property &#8216;HorizontalOffset&#8217; was not found in type &#8216;ScrollViewerBinding&#8217;. [Line: 254 Position: 55]</p>
<p>in InitializeComponent(); method.</p>
<p>this is my implementation &#8211; preaty same. </p>
<p>utils:ScrollViewerBinding.HorizontalOffset=&#8221;{Binding YPosition, Mode=TwoWay}&#8221; inside ScrollViewer tag</p>
<p>I just dont know what Im doing wring.. Can anybody help me out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CB</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-65854</link>
		<dc:creator>CB</dc:creator>
		<pubDate>Tue, 19 Jul 2011 19:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-65854</guid>
		<description>Where is the -1 used?  If I use it in the Metadata for the dependency property, I get a data type mismatch exception.</description>
		<content:encoded><![CDATA[<p>Where is the -1 used?  If I use it in the Metadata for the dependency property, I get a data type mismatch exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-62093</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Fri, 01 Jul 2011 07:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-62093</guid>
		<description>Well spotted ... although I have no idea why! If you find a solution, please let me know.</description>
		<content:encoded><![CDATA[<p>Well spotted &#8230; although I have no idea why! If you find a solution, please let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Sampson</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-61434</link>
		<dc:creator>Bob Sampson</dc:creator>
		<pubDate>Mon, 27 Jun 2011 19:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-61434</guid>
		<description>It looks like this isn&#039;t updated via the mouse wheel when it&#039;s scrolling?</description>
		<content:encoded><![CDATA[<p>It looks like this isn&#8217;t updated via the mouse wheel when it&#8217;s scrolling?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-45615</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Fri, 11 Mar 2011 16:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-45615</guid>
		<description>Cool - thanks for the fix!</description>
		<content:encoded><![CDATA[<p>Cool &#8211; thanks for the fix!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesco De Vittori</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/exposing-and-binding-to-a-silverlight-scrollviewer%e2%80%99s-scrollbars/#comment-45586</link>
		<dc:creator>Francesco De Vittori</dc:creator>
		<pubDate>Fri, 11 Mar 2011 13:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=740#comment-45586</guid>
		<description>I know this entry is old, but I&#039;ve found a small issue.

Your attached property initializes itself the first time that the OnVerticalOffsetPropertyChanged handler is called, this means that if the bound property is 0.0 the callback is not called and the attached property not initialized (thus the binding does not work).

You can see this if you comment out the explicit _xPosition = 10; _yPosition _ 10; in the MainPage constructor.

The solution is simple: you can just set -1 as default value for the attached property, this makes sure the value immediately changes and the callback is called immediately.

Anyways thanks for sharing, this has been very useful.</description>
		<content:encoded><![CDATA[<p>I know this entry is old, but I&#8217;ve found a small issue.</p>
<p>Your attached property initializes itself the first time that the OnVerticalOffsetPropertyChanged handler is called, this means that if the bound property is 0.0 the callback is not called and the attached property not initialized (thus the binding does not work).</p>
<p>You can see this if you comment out the explicit _xPosition = 10; _yPosition _ 10; in the MainPage constructor.</p>
<p>The solution is simple: you can just set -1 as default value for the attached property, this makes sure the value immediately changes and the callback is called immediately.</p>
<p>Anyways thanks for sharing, this has been very useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

