<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.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>Report a Silverlight Bug</title><link>http://forums.silverlight.net/forums/28.aspx</link><description>Found a bug in Silverlight? Use this forum to describe the bug and the code or steps to reproduce it.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: How to get a Scroll event from a ScrollViewer</title><link>http://forums.silverlight.net/forums/thread/284232.aspx</link><pubDate>Wed, 09 Sep 2009 10:33:56 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:284232</guid><dc:creator>jitendrachhajed</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/284232.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=284232</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi jpscott,&lt;/p&gt;&lt;p&gt;If possible please post the code snippet that your are using.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Jitendra Chhajed &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How to get a Scroll event from a ScrollViewer</title><link>http://forums.silverlight.net/forums/thread/64346.aspx</link><pubDate>Mon, 23 Jun 2008 19:22:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:64346</guid><dc:creator>jpsscott</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/64346.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=64346</wfw:commentRss><description>&lt;p&gt;Alright,&lt;/p&gt;
&lt;p&gt;Very happy to say that I have got something that works well for me and I hope others will be able to use it too!&amp;nbsp; Use a class called VisualTreeHelper.GetChild&amp;nbsp;to get a reference to the first child in the ScrollViewer, cast it to a frameworkelement or whatever to call FindName on it, then use FindName to do a search for &amp;quot;VerticalScrollBar&amp;quot; or &amp;quot;HorizontalScrollBar&amp;quot;.&amp;nbsp; From there, listen to the scroll event.&lt;/p&gt;
&lt;p&gt;Make sure you do it from the LayoutUpdated event on the scrollviewer or after so that the VisualTreeHelper class picks up the children.&amp;nbsp; I found that before the layout_udpated event it did not.&lt;/p&gt;
&lt;p&gt;James&lt;/p&gt;</description></item><item><title>Re: How to get a Scroll event from a ScrollViewer</title><link>http://forums.silverlight.net/forums/thread/63629.aspx</link><pubDate>Fri, 20 Jun 2008 21:02:28 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:63629</guid><dc:creator>dcstraw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/63629.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=63629</wfw:commentRss><description>&lt;p&gt;OK I thought of a different way but it&amp;#39;s kind of ugly.&amp;nbsp; You can handle the LayoutUpdated event of the scroll viewer like this:&lt;/p&gt;
&lt;p&gt;void ScrollViewer_LayoutUpdated(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!_SkipLayoutEvent)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SkipLayoutEvent = true;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnScroll();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SkipLayoutEvent = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;The _SkipLayoutEvent&amp;nbsp;was necessary because any time I updated any other part of the UI it kicked off the ScrollViewer&amp;#39;s LayoutUpdated event again, even if the updated UI wasn&amp;#39;t inside the scroll viewer.&amp;nbsp; I&amp;#39;m not sure why this happens, but if you don&amp;#39;t account for it you get layout error due to an infinite loop.&amp;nbsp; The biggest downside to this implementation is that the event will get kicked off for&amp;nbsp;a lot of things besides scrolling, but it does at least get fired off every time the user scrolls.&lt;/p&gt;</description></item><item><title>Re: How to get a Scroll event from a ScrollViewer</title><link>http://forums.silverlight.net/forums/thread/63625.aspx</link><pubDate>Fri, 20 Jun 2008 20:38:31 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:63625</guid><dc:creator>dcstraw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/63625.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=63625</wfw:commentRss><description>&lt;p&gt;I created a custom ScrollViewer by wrapping the existing one with a custom control.&amp;nbsp; I made a TemplatePart of type ScrollViewer,&amp;nbsp;which my&amp;nbsp;default style defined.&amp;nbsp; Then I made my own corresponding &amp;quot;HorizontalOffset&amp;quot;, &amp;quot;ScrollToVerticalOffset()&amp;quot;, etc members that passed on the call to the actual scroll viewer.&amp;nbsp; If you did this then you could make a callback on your custom dependency properties that fires an event.&lt;/p&gt;
&lt;p&gt;Of course, a scroll event would be much cleaner, so hopefully MSFT will implement it in a later version.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[Edit: On second thought, this probably won&amp;#39;t work for you if you are still letting the user scroll using the scroll bars.&amp;nbsp; In my case I implemented a different method of scrolling (dragging on the content to &amp;quot;pan&amp;quot;) so the scroll viewer&amp;#39;s properties never changed except through my custom control.]&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>How to get a Scroll event from a ScrollViewer</title><link>http://forums.silverlight.net/forums/thread/63602.aspx</link><pubDate>Fri, 20 Jun 2008 19:24:52 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:63602</guid><dc:creator>jpsscott</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/63602.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=63602</wfw:commentRss><description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;I really need a scroll event in the ScrollViewer to keep a few scrollviewer windows in synch.&amp;nbsp; It doesn&amp;#39;t appear that SL will ever support a Scroll event so now I&amp;#39;m stuck trying to write my own ScrollViewer.&amp;nbsp; I figured I could do it similar to the ScrollViewer by using a ScrollContentPresenter and a couple of ScrollBars.&amp;nbsp; So far, this isn&amp;#39;t doing the trick however.&amp;nbsp; I can&amp;#39;t get past getting the ScrollContentPresenter to do anything.&amp;nbsp; Can&amp;#39;t find any examples on how to do this either.&lt;/p&gt;
&lt;p&gt;So could someone:&lt;/p&gt;
&lt;p&gt;a) recommend a way to get a scroll event from the ScrollViewer?&lt;/p&gt;
&lt;p&gt;b) Show me how to use the ScrollContentPresenter control to display something?&lt;/p&gt;
&lt;p&gt;I use xaml like this for ScrollContentPresenter &amp;lt;ScrollContentPresenter Content=&amp;quot;Some Content&amp;quot;/&amp;gt;&amp;nbsp; I&amp;#39;ve also tried inserting content like &amp;lt;ScrollContentPresenter.Content&amp;gt; underneath the ScrollContentPresenter&amp;nbsp;tag.&amp;nbsp; Unfortunately I&amp;#39;m getting nowhere.&lt;/p&gt;
&lt;p&gt;Please advise...&lt;/p&gt;
&lt;p&gt;James&lt;/p&gt;</description></item></channel></rss>