{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/comments/77346605","id":77346605,"diff_hunk":"@@ -0,0 +1,248 @@\n+﻿// ******************************************************************\n+// Copyright (c) Microsoft. All rights reserved.\n+// This code is licensed under the MIT License (MIT).\n+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH\n+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.\n+// ******************************************************************\n+using System;\n+using Windows.UI.Composition;\n+using Windows.UI.Xaml;\n+using Windows.UI.Xaml.Controls;\n+using Windows.UI.Xaml.Hosting;\n+using Windows.UI.Xaml.Media;\n+\n+namespace Microsoft.Toolkit.Uwp.UI.Controls\n+{\n+    /// <summary>\n+    /// Quick return header control to be used with ListViews\n+    /// </summary>\n+    public class QuickReturnHeader : ContentControl\n+    {\n+        private ScrollViewer _scrollViewer;\n+        private double _previousVerticalScrollOffset;\n+        private CompositionPropertySet _scrollProperties;\n+        private CompositionPropertySet _animationProperties;\n+        private Visual _headerVisual;\n+\n+        public QuickReturnHeader()\n+        {\n+            HorizontalContentAlignment = HorizontalAlignment.Stretch;\n+        }\n+\n+        /// <summary>\n+        /// Identifies the <see cref=\"IsQuickReturnEnabled\"/> property.\n+        /// </summary>\n+        public static readonly DependencyProperty IsQuickReturnEnabledProperty =\n+            DependencyProperty.Register(nameof(IsQuickReturnEnabled), typeof(bool), typeof(QuickReturnHeader), new PropertyMetadata(true, OnIsQuickReturnEnabledChanged));\n+\n+        /// <summary>\n+        /// Gets or sets a value indicating whether the quick return header is enabled.\n+        /// If true the quick return behavior is used.\n+        /// If false regular header behavior is used.\n+        /// Default is true.\n+        /// </summary>\n+        public bool IsQuickReturnEnabled\n+        {\n+            get { return (bool)GetValue(IsQuickReturnEnabledProperty); }\n+            set { SetValue(IsQuickReturnEnabledProperty, value); }\n+        }\n+\n+        /// <summary>\n+        /// Identifies the <see cref=\"IsSticky\"/> property.\n+        /// </summary>\n+        public static readonly DependencyProperty IsStickyProperty =\n+            DependencyProperty.Register(nameof(IsSticky), typeof(bool), typeof(QuickReturnHeader), new PropertyMetadata(false, OnIsStickyChanged));\n+\n+        /// <summary>\n+        /// Gets or sets a value indicating whether the quick return header should always be visible.\n+        /// If true the header is always visible.\n+        /// If false the header will move out of view when scrolling down.\n+        /// Default is false.\n+        /// </summary>\n+        public bool IsSticky\n+        {\n+            get { return (bool)GetValue(IsStickyProperty); }\n+            set { SetValue(IsStickyProperty, value); }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets the ListView this header belongs to\n+        /// </summary>\n+        public ListView TargetListView { get; set; }","path":"Microsoft.Toolkit.Uwp.UI.Controls/QuickReturnHeader/QuickReturnHeader.cs","position":null,"original_position":76,"commit_id":"717fd254e020fab159d02a4fb126d16381cd27a8","original_commit_id":"3bd61438617aa8c875a4e99907126cd502bc9a62","user":{"login":"LanceMcCarthy","id":3520532,"avatar_url":"https://avatars.githubusercontent.com/u/3520532?v=3","gravatar_id":"","url":"https://api.github.com/users/LanceMcCarthy","html_url":"https://github.com/LanceMcCarthy","followers_url":"https://api.github.com/users/LanceMcCarthy/followers","following_url":"https://api.github.com/users/LanceMcCarthy/following{/other_user}","gists_url":"https://api.github.com/users/LanceMcCarthy/gists{/gist_id}","starred_url":"https://api.github.com/users/LanceMcCarthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LanceMcCarthy/subscriptions","organizations_url":"https://api.github.com/users/LanceMcCarthy/orgs","repos_url":"https://api.github.com/users/LanceMcCarthy/repos","events_url":"https://api.github.com/users/LanceMcCarthy/events{/privacy}","received_events_url":"https://api.github.com/users/LanceMcCarthy/received_events","type":"User","site_admin":false},"body":"@pdehne you should be able to use FindAscentant<ListViewBase> and get the ListView (or GridView) https://github.com/Microsoft/UWPCommunityToolkit/blob/dev/Microsoft.Toolkit.Uwp.UI/Extensions/VisualTreeExtensions.cs#L93\r\n\r\nIn theory, this should also work for custom controls, but if it doesn;t you still have the TargetListView D.P. to fallback on.\r\n","created_at":"2016-09-02T13:36:13Z","updated_at":"2016-09-02T13:36:13Z","html_url":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227#discussion_r77346605","pull_request_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/comments/77346605"},"html":{"href":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227#discussion_r77346605"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227","id":82388609,"html_url":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227","diff_url":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227.diff","patch_url":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227.patch","issue_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/227","number":227,"state":"open","locked":false,"title":"Add a quick return header control","user":{"login":"pdehne","id":1521198,"avatar_url":"https://avatars.githubusercontent.com/u/1521198?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehne","html_url":"https://github.com/pdehne","followers_url":"https://api.github.com/users/pdehne/followers","following_url":"https://api.github.com/users/pdehne/following{/other_user}","gists_url":"https://api.github.com/users/pdehne/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehne/subscriptions","organizations_url":"https://api.github.com/users/pdehne/orgs","repos_url":"https://api.github.com/users/pdehne/repos","events_url":"https://api.github.com/users/pdehne/events{/privacy}","received_events_url":"https://api.github.com/users/pdehne/received_events","type":"User","site_admin":false},"body":"Adds QuickReturnHeader as discussed in #165 ","created_at":"2016-08-23T15:36:23Z","updated_at":"2016-09-02T13:36:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed689f8460fea17b1634196a6032d537c08fedd7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227/commits","review_comments_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227/comments","review_comment_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/227/comments","statuses_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/statuses/717fd254e020fab159d02a4fb126d16381cd27a8","head":{"label":"pdehne:dev","ref":"dev","sha":"717fd254e020fab159d02a4fb126d16381cd27a8","user":{"login":"pdehne","id":1521198,"avatar_url":"https://avatars.githubusercontent.com/u/1521198?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehne","html_url":"https://github.com/pdehne","followers_url":"https://api.github.com/users/pdehne/followers","following_url":"https://api.github.com/users/pdehne/following{/other_user}","gists_url":"https://api.github.com/users/pdehne/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehne/subscriptions","organizations_url":"https://api.github.com/users/pdehne/orgs","repos_url":"https://api.github.com/users/pdehne/repos","events_url":"https://api.github.com/users/pdehne/events{/privacy}","received_events_url":"https://api.github.com/users/pdehne/received_events","type":"User","site_admin":false},"repo":{"id":66371470,"name":"UWPCommunityToolkit","full_name":"pdehne/UWPCommunityToolkit","owner":{"login":"pdehne","id":1521198,"avatar_url":"https://avatars.githubusercontent.com/u/1521198?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehne","html_url":"https://github.com/pdehne","followers_url":"https://api.github.com/users/pdehne/followers","following_url":"https://api.github.com/users/pdehne/following{/other_user}","gists_url":"https://api.github.com/users/pdehne/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehne/subscriptions","organizations_url":"https://api.github.com/users/pdehne/orgs","repos_url":"https://api.github.com/users/pdehne/repos","events_url":"https://api.github.com/users/pdehne/events{/privacy}","received_events_url":"https://api.github.com/users/pdehne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pdehne/UWPCommunityToolkit","description":"The UWP Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10.","fork":true,"url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit","forks_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/forks","keys_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/teams","hooks_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/hooks","issue_events_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/issues/events{/number}","events_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/events","assignees_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/assignees{/user}","branches_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/branches{/branch}","tags_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/tags","blobs_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/languages","stargazers_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/stargazers","contributors_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/contributors","subscribers_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/subscribers","subscription_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/subscription","commits_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/contents/{+path}","compare_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/merges","archive_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/downloads","issues_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/issues{/number}","pulls_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/labels{/name}","releases_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/releases{/id}","deployments_url":"https://api.github.com/repos/pdehne/UWPCommunityToolkit/deployments","created_at":"2016-08-23T13:53:36Z","updated_at":"2016-08-23T13:53:38Z","pushed_at":"2016-09-02T12:02:59Z","git_url":"git://github.com/pdehne/UWPCommunityToolkit.git","ssh_url":"git@github.com:pdehne/UWPCommunityToolkit.git","clone_url":"https://github.com/pdehne/UWPCommunityToolkit.git","svn_url":"https://github.com/pdehne/UWPCommunityToolkit","homepage":"","size":54808,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Microsoft:dev","ref":"dev","sha":"1f1f5da6d9ef9c94ae6ef80f46544316ddf2d1a4","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":61403402,"name":"UWPCommunityToolkit","full_name":"Microsoft/UWPCommunityToolkit","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/UWPCommunityToolkit","description":"The UWP Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10.","fork":false,"url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit","forks_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/forks","keys_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/teams","hooks_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/events","assignees_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/tags","blobs_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/languages","stargazers_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/subscription","commits_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/merges","archive_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/downloads","issues_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/deployments","created_at":"2016-06-17T21:29:46Z","updated_at":"2016-09-02T09:41:53Z","pushed_at":"2016-09-02T12:02:59Z","git_url":"git://github.com/Microsoft/UWPCommunityToolkit.git","ssh_url":"git@github.com:Microsoft/UWPCommunityToolkit.git","clone_url":"https://github.com/Microsoft/UWPCommunityToolkit.git","svn_url":"https://github.com/Microsoft/UWPCommunityToolkit","homepage":"","size":173505,"stargazers_count":519,"watchers_count":519,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":117,"mirror_url":null,"open_issues_count":72,"forks":117,"open_issues":72,"watchers":519,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227"},"html":{"href":"https://github.com/Microsoft/UWPCommunityToolkit/pull/227"},"issue":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/227"},"comments":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/UWPCommunityToolkit/statuses/717fd254e020fab159d02a4fb126d16381cd27a8"}}}}
{"actor":{"display_login":"LanceMcCarthy"}}