{"action":"created","comment":{"url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/comments/42741644","id":42741644,"diff_hunk":"@@ -0,0 +1,84 @@\n+﻿namespace MahApps.Metro.Controls\n+{\n+    using System.Windows;\n+    using System.Windows.Controls;\n+    using System.Windows.Input;\n+\n+    public class SliderHelper\n+    {\n+        public static readonly DependencyProperty ChangeValueByProperty = DependencyProperty.RegisterAttached(\n+            \"ChangeValueBy\",\n+            typeof(MouseWheelChange),\n+            typeof(SliderHelper),\n+            new PropertyMetadata(MouseWheelChange.SmallChange));\n+        public static readonly DependencyProperty EnableMouseWheelProperty = DependencyProperty.RegisterAttached(\n+            \"EnableMouseWheel\",\n+            typeof(MouseWheelState),\n+            typeof(SliderHelper),\n+            new PropertyMetadata(MouseWheelState.None, OnEnableMouseWheelChanged));\n+        \n+        public static MouseWheelChange GetChangeValueBy(DependencyObject element)\n+        {\n+            return (MouseWheelChange)element.GetValue(ChangeValueByProperty);\n+        }\n+\n+        public static MouseWheelState GetEnableMouseWheel(DependencyObject element)\n+        {\n+            return (MouseWheelState)element.GetValue(EnableMouseWheelProperty);\n+        }\n+\n+        private static void OnEnableMouseWheelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n+        {\n+            var slider = ((Slider)d);\n+            if ((MouseWheelState)e.NewValue != MouseWheelState.None)\n+            {\n+                slider.Unloaded += OnUnloaded;\n+                slider.PreviewMouseWheel += OnPreviewMouseWheel;\n+            }\n+            else\n+            {\n+                UnregisterEvents(slider);\n+            }\n+        }","path":"MahApps.Metro/Controls/Helper/SliderHelper.cs","position":42,"original_position":42,"commit_id":"7fc25c82abed9959281dfcae939b462b4d789ca3","original_commit_id":"7fc25c82abed9959281dfcae939b462b4d789ca3","user":{"login":"punker76","id":658431,"avatar_url":"https://avatars.githubusercontent.com/u/658431?v=3","gravatar_id":"","url":"https://api.github.com/users/punker76","html_url":"https://github.com/punker76","followers_url":"https://api.github.com/users/punker76/followers","following_url":"https://api.github.com/users/punker76/following{/other_user}","gists_url":"https://api.github.com/users/punker76/gists{/gist_id}","starred_url":"https://api.github.com/users/punker76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punker76/subscriptions","organizations_url":"https://api.github.com/users/punker76/orgs","repos_url":"https://api.github.com/users/punker76/repos","events_url":"https://api.github.com/users/punker76/events{/privacy}","received_events_url":"https://api.github.com/users/punker76/received_events","type":"User","site_admin":false},"body":"we should always unregister the events\r\n\r\n```csharp\r\nif (e.NewValue != e.OldValue)\r\n{\r\n\tvar slider = (Slider)d;\r\n\tUnregisterEvents(slider);\r\n\tif ((MouseWheelState)e.NewValue != MouseWheelState.None)\r\n\t{\r\n\t    slider.Unloaded += OnUnloaded;\r\n\t    slider.PreviewMouseWheel += OnPreviewMouseWheel;\r\n\t}\r\n}\r\n```","created_at":"2015-10-22T12:30:33Z","updated_at":"2015-10-22T12:30:33Z","html_url":"https://github.com/MahApps/MahApps.Metro/pull/2171#discussion_r42741644","pull_request_url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171","_links":{"self":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/comments/42741644"},"html":{"href":"https://github.com/MahApps/MahApps.Metro/pull/2171#discussion_r42741644"},"pull_request":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171"}}},"pull_request":{"url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171","id":48197956,"html_url":"https://github.com/MahApps/MahApps.Metro/pull/2171","diff_url":"https://github.com/MahApps/MahApps.Metro/pull/2171.diff","patch_url":"https://github.com/MahApps/MahApps.Metro/pull/2171.patch","issue_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2171","number":2171,"state":"open","locked":false,"title":"Change Slider value on MouseWheel event.","user":{"login":"xxMUROxx","id":4341039,"avatar_url":"https://avatars.githubusercontent.com/u/4341039?v=3","gravatar_id":"","url":"https://api.github.com/users/xxMUROxx","html_url":"https://github.com/xxMUROxx","followers_url":"https://api.github.com/users/xxMUROxx/followers","following_url":"https://api.github.com/users/xxMUROxx/following{/other_user}","gists_url":"https://api.github.com/users/xxMUROxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxMUROxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxMUROxx/subscriptions","organizations_url":"https://api.github.com/users/xxMUROxx/orgs","repos_url":"https://api.github.com/users/xxMUROxx/repos","events_url":"https://api.github.com/users/xxMUROxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxMUROxx/received_events","type":"User","site_admin":false},"body":"Possibility to rotate the mouse wheel and change the value of the slider in following situations:\r\n    * None\r\n    * Only when the slider is focuesed and the mouse wheel is rotated\r\n    * If the mouse pointer is over the slider and the mouse wheel is rotated","created_at":"2015-10-20T13:09:28Z","updated_at":"2015-10-22T12:30:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b6239910b5784a8bcbcd8c25249274fb09e21da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171/commits","review_comments_url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171/comments","review_comment_url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2171/comments","statuses_url":"https://api.github.com/repos/MahApps/MahApps.Metro/statuses/7fc25c82abed9959281dfcae939b462b4d789ca3","head":{"label":"xxMUROxx:feature/SliderExtensions","ref":"feature/SliderExtensions","sha":"7fc25c82abed9959281dfcae939b462b4d789ca3","user":{"login":"xxMUROxx","id":4341039,"avatar_url":"https://avatars.githubusercontent.com/u/4341039?v=3","gravatar_id":"","url":"https://api.github.com/users/xxMUROxx","html_url":"https://github.com/xxMUROxx","followers_url":"https://api.github.com/users/xxMUROxx/followers","following_url":"https://api.github.com/users/xxMUROxx/following{/other_user}","gists_url":"https://api.github.com/users/xxMUROxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxMUROxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxMUROxx/subscriptions","organizations_url":"https://api.github.com/users/xxMUROxx/orgs","repos_url":"https://api.github.com/users/xxMUROxx/repos","events_url":"https://api.github.com/users/xxMUROxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxMUROxx/received_events","type":"User","site_admin":false},"repo":{"id":14931833,"name":"MahApps.Metro","full_name":"xxMUROxx/MahApps.Metro","owner":{"login":"xxMUROxx","id":4341039,"avatar_url":"https://avatars.githubusercontent.com/u/4341039?v=3","gravatar_id":"","url":"https://api.github.com/users/xxMUROxx","html_url":"https://github.com/xxMUROxx","followers_url":"https://api.github.com/users/xxMUROxx/followers","following_url":"https://api.github.com/users/xxMUROxx/following{/other_user}","gists_url":"https://api.github.com/users/xxMUROxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxMUROxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxMUROxx/subscriptions","organizations_url":"https://api.github.com/users/xxMUROxx/orgs","repos_url":"https://api.github.com/users/xxMUROxx/repos","events_url":"https://api.github.com/users/xxMUROxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxMUROxx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xxMUROxx/MahApps.Metro","description":"Toolkit for creating Metro styled WPF apps","fork":true,"url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro","forks_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/forks","keys_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/teams","hooks_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/hooks","issue_events_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/issues/events{/number}","events_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/events","assignees_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/assignees{/user}","branches_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/branches{/branch}","tags_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/tags","blobs_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/git/refs{/sha}","trees_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/statuses/{sha}","languages_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/languages","stargazers_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/stargazers","contributors_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/contributors","subscribers_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/subscribers","subscription_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/subscription","commits_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/commits{/sha}","git_commits_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/git/commits{/sha}","comments_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/comments{/number}","issue_comment_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/issues/comments{/number}","contents_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/contents/{+path}","compare_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/merges","archive_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/downloads","issues_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/issues{/number}","pulls_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/pulls{/number}","milestones_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/milestones{/number}","notifications_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/labels{/name}","releases_url":"https://api.github.com/repos/xxMUROxx/MahApps.Metro/releases{/id}","created_at":"2013-12-04T18:16:24Z","updated_at":"2015-01-13T10:22:12Z","pushed_at":"2015-10-20T13:06:50Z","git_url":"git://github.com/xxMUROxx/MahApps.Metro.git","ssh_url":"git@github.com:xxMUROxx/MahApps.Metro.git","clone_url":"https://github.com/xxMUROxx/MahApps.Metro.git","svn_url":"https://github.com/xxMUROxx/MahApps.Metro","homepage":"http://mahapps.com/MahApps.Metro/","size":12796,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"MahApps:master","ref":"master","sha":"ed6c3169f34b83d139d7ec1aab256e4b96b8c39a","user":{"login":"MahApps","id":1130789,"avatar_url":"https://avatars.githubusercontent.com/u/1130789?v=3","gravatar_id":"","url":"https://api.github.com/users/MahApps","html_url":"https://github.com/MahApps","followers_url":"https://api.github.com/users/MahApps/followers","following_url":"https://api.github.com/users/MahApps/following{/other_user}","gists_url":"https://api.github.com/users/MahApps/gists{/gist_id}","starred_url":"https://api.github.com/users/MahApps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahApps/subscriptions","organizations_url":"https://api.github.com/users/MahApps/orgs","repos_url":"https://api.github.com/users/MahApps/repos","events_url":"https://api.github.com/users/MahApps/events{/privacy}","received_events_url":"https://api.github.com/users/MahApps/received_events","type":"Organization","site_admin":false},"repo":{"id":2584777,"name":"MahApps.Metro","full_name":"MahApps/MahApps.Metro","owner":{"login":"MahApps","id":1130789,"avatar_url":"https://avatars.githubusercontent.com/u/1130789?v=3","gravatar_id":"","url":"https://api.github.com/users/MahApps","html_url":"https://github.com/MahApps","followers_url":"https://api.github.com/users/MahApps/followers","following_url":"https://api.github.com/users/MahApps/following{/other_user}","gists_url":"https://api.github.com/users/MahApps/gists{/gist_id}","starred_url":"https://api.github.com/users/MahApps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahApps/subscriptions","organizations_url":"https://api.github.com/users/MahApps/orgs","repos_url":"https://api.github.com/users/MahApps/repos","events_url":"https://api.github.com/users/MahApps/events{/privacy}","received_events_url":"https://api.github.com/users/MahApps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MahApps/MahApps.Metro","description":"A toolkit for creating Metro / Modern UI styled WPF apps.","fork":false,"url":"https://api.github.com/repos/MahApps/MahApps.Metro","forks_url":"https://api.github.com/repos/MahApps/MahApps.Metro/forks","keys_url":"https://api.github.com/repos/MahApps/MahApps.Metro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MahApps/MahApps.Metro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MahApps/MahApps.Metro/teams","hooks_url":"https://api.github.com/repos/MahApps/MahApps.Metro/hooks","issue_events_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/events{/number}","events_url":"https://api.github.com/repos/MahApps/MahApps.Metro/events","assignees_url":"https://api.github.com/repos/MahApps/MahApps.Metro/assignees{/user}","branches_url":"https://api.github.com/repos/MahApps/MahApps.Metro/branches{/branch}","tags_url":"https://api.github.com/repos/MahApps/MahApps.Metro/tags","blobs_url":"https://api.github.com/repos/MahApps/MahApps.Metro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MahApps/MahApps.Metro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MahApps/MahApps.Metro/git/refs{/sha}","trees_url":"https://api.github.com/repos/MahApps/MahApps.Metro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MahApps/MahApps.Metro/statuses/{sha}","languages_url":"https://api.github.com/repos/MahApps/MahApps.Metro/languages","stargazers_url":"https://api.github.com/repos/MahApps/MahApps.Metro/stargazers","contributors_url":"https://api.github.com/repos/MahApps/MahApps.Metro/contributors","subscribers_url":"https://api.github.com/repos/MahApps/MahApps.Metro/subscribers","subscription_url":"https://api.github.com/repos/MahApps/MahApps.Metro/subscription","commits_url":"https://api.github.com/repos/MahApps/MahApps.Metro/commits{/sha}","git_commits_url":"https://api.github.com/repos/MahApps/MahApps.Metro/git/commits{/sha}","comments_url":"https://api.github.com/repos/MahApps/MahApps.Metro/comments{/number}","issue_comment_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/comments{/number}","contents_url":"https://api.github.com/repos/MahApps/MahApps.Metro/contents/{+path}","compare_url":"https://api.github.com/repos/MahApps/MahApps.Metro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MahApps/MahApps.Metro/merges","archive_url":"https://api.github.com/repos/MahApps/MahApps.Metro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MahApps/MahApps.Metro/downloads","issues_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues{/number}","pulls_url":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls{/number}","milestones_url":"https://api.github.com/repos/MahApps/MahApps.Metro/milestones{/number}","notifications_url":"https://api.github.com/repos/MahApps/MahApps.Metro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MahApps/MahApps.Metro/labels{/name}","releases_url":"https://api.github.com/repos/MahApps/MahApps.Metro/releases{/id}","created_at":"2011-10-16T04:16:10Z","updated_at":"2015-10-22T06:37:46Z","pushed_at":"2015-10-21T08:59:38Z","git_url":"git://github.com/MahApps/MahApps.Metro.git","ssh_url":"git@github.com:MahApps/MahApps.Metro.git","clone_url":"https://github.com/MahApps/MahApps.Metro.git","svn_url":"https://github.com/MahApps/MahApps.Metro","homepage":"http://mahapps.com","size":34394,"stargazers_count":1821,"watchers_count":1821,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":934,"mirror_url":null,"open_issues_count":110,"forks":934,"open_issues":110,"watchers":1821,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171"},"html":{"href":"https://github.com/MahApps/MahApps.Metro/pull/2171"},"issue":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2171"},"comments":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2171/comments"},"review_comments":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171/comments"},"review_comment":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/pulls/2171/commits"},"statuses":{"href":"https://api.github.com/repos/MahApps/MahApps.Metro/statuses/7fc25c82abed9959281dfcae939b462b4d789ca3"}}}}