From 3f4f13089cd8f3f0b2226e203b3d3faac2fec26b Mon Sep 17 00:00:00 2001 From: Vijay Nirmal Date: Sun, 12 Jul 2020 00:42:37 +0530 Subject: [PATCH] Review Changes - Files Reorg --- ...cs => ListViewExtensions.AlternateRows.cs} | 25 ----------- ...istViewExtensions.SmoothScrollIntoView.cs} | 2 +- ...ListViewExtensions.StretchItemContainer.cs | 44 +++++++++++++++++++ 3 files changed, 45 insertions(+), 26 deletions(-) rename Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/{ListViewExtensions.cs => ListViewExtensions.AlternateRows.cs} (84%) rename Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/{SmoothScrollIntoView.cs => ListViewExtensions.SmoothScrollIntoView.cs} (99%) create mode 100644 Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.StretchItemContainer.cs diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.AlternateRows.cs similarity index 84% rename from Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.cs rename to Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.AlternateRows.cs index c9ad2e4cbf9..53d7355371f 100644 --- a/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.cs +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.AlternateRows.cs @@ -28,11 +28,6 @@ public static partial class ListViewExtensions /// public static readonly DependencyProperty AlternateItemTemplateProperty = DependencyProperty.RegisterAttached("AlternateItemTemplate", typeof(DataTemplate), typeof(ListViewExtensions), new PropertyMetadata(null, OnAlternateItemTemplatePropertyChanged)); - /// - /// Attached for setting the container content stretch direction on the - /// - public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnItemContainerStretchDirectionPropertyChanged)); - /// /// Gets the alternate associated with the specified /// @@ -73,26 +68,6 @@ public static void SetAlternateItemTemplate(Windows.UI.Xaml.Controls.ListViewBas obj.SetValue(AlternateItemTemplateProperty, value); } - /// - /// Gets the stretch associated with the specified - /// - /// The to get the associated from - /// The associated with the - public static ItemContainerStretchDirection GetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj) - { - return (ItemContainerStretchDirection)obj.GetValue(ItemContainerStretchDirectionProperty); - } - - /// - /// Sets the stretch associated with the specified - /// - /// The to associate the with - /// The for binding to the - public static void SetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj, ItemContainerStretchDirection value) - { - obj.SetValue(ItemContainerStretchDirectionProperty, value); - } - private static void OnAlternateColorPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { Windows.UI.Xaml.Controls.ListViewBase listViewBase = sender as Windows.UI.Xaml.Controls.ListViewBase; diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/SmoothScrollIntoView.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.SmoothScrollIntoView.cs similarity index 99% rename from Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/SmoothScrollIntoView.cs rename to Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.SmoothScrollIntoView.cs index 777835ce229..75628d1c995 100644 --- a/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/SmoothScrollIntoView.cs +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.SmoothScrollIntoView.cs @@ -14,7 +14,7 @@ namespace Microsoft.Toolkit.Uwp.UI /// /// Smooth scroll the list to bring specified item into view /// - public static class SmoothScrollIntoView + public static partial class ListViewExtensions { /// /// Smooth scrolling the list to bring the specified index into view diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.StretchItemContainer.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.StretchItemContainer.cs new file mode 100644 index 00000000000..3097c02fbb9 --- /dev/null +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.StretchItemContainer.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Media; + +namespace Microsoft.Toolkit.Uwp.UI +{ + /// + /// Provides attached dependency properties for the + /// + public static partial class ListViewExtensions + { + /// + /// Attached for setting the container content stretch direction on the + /// + public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnItemContainerStretchDirectionPropertyChanged)); + + /// + /// Gets the stretch associated with the specified + /// + /// The to get the associated from + /// The associated with the + public static ItemContainerStretchDirection GetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj) + { + return (ItemContainerStretchDirection)obj.GetValue(ItemContainerStretchDirectionProperty); + } + + /// + /// Sets the stretch associated with the specified + /// + /// The to associate the with + /// The for binding to the + public static void SetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj, ItemContainerStretchDirection value) + { + obj.SetValue(ItemContainerStretchDirectionProperty, value); + } + } +}