Skip to content

Commit 60008a5

Browse files
committed
Renamed StretchDirection enum type and property
1 parent 9c683cc commit 60008a5

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/StretchDirection.cs renamed to Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ItemContainerStretchDirection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Microsoft.Toolkit.Uwp.UI
77
/// <summary>
88
/// Stretch direction
99
/// </summary>
10-
public enum StretchDirection
10+
public enum ItemContainerStretchDirection
1111
{
1212
/// <summary>
1313
/// Horizontal stretch

Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static partial class ListViewExtensions
3131
/// <summary>
3232
/// Attached <see cref="DependencyProperty"/> for setting the container content stretch direction on the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
3333
/// </summary>
34-
public static readonly DependencyProperty StretchItemContainerDirectionProperty = DependencyProperty.RegisterAttached("StretchItemContainerDirection", typeof(StretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnStretchItemContainerDirectionPropertyChanged));
34+
public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnStretchItemContainerDirectionPropertyChanged));
3535

3636
/// <summary>
3737
/// Gets the alternate <see cref="Brush"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
@@ -74,23 +74,23 @@ public static void SetAlternateItemTemplate(Windows.UI.Xaml.Controls.ListViewBas
7474
}
7575

7676
/// <summary>
77-
/// Gets the stretch <see cref="StretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
77+
/// Gets the stretch <see cref="ItemContainerStretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
7878
/// </summary>
79-
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to get the associated <see cref="StretchDirection"/> from</param>
80-
/// <returns>The <see cref="StretchDirection"/> associated with the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></returns>
81-
public static StretchDirection GetStretchItemContainerDirection(Windows.UI.Xaml.Controls.ListViewBase obj)
79+
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to get the associated <see cref="ItemContainerStretchDirection"/> from</param>
80+
/// <returns>The <see cref="ItemContainerStretchDirection"/> associated with the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></returns>
81+
public static ItemContainerStretchDirection GetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj)
8282
{
83-
return (StretchDirection)obj.GetValue(StretchItemContainerDirectionProperty);
83+
return (ItemContainerStretchDirection)obj.GetValue(ItemContainerStretchDirectionProperty);
8484
}
8585

8686
/// <summary>
87-
/// Sets the stretch <see cref="StretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
87+
/// Sets the stretch <see cref="ItemContainerStretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
8888
/// </summary>
89-
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to associate the <see cref="StretchDirection"/> with</param>
90-
/// <param name="value">The <see cref="StretchDirection"/> for binding to the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></param>
91-
public static void SetStretchItemContainerDirection(Windows.UI.Xaml.Controls.ListViewBase obj, StretchDirection value)
89+
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to associate the <see cref="ItemContainerStretchDirection"/> with</param>
90+
/// <param name="value">The <see cref="ItemContainerStretchDirection"/> for binding to the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></param>
91+
public static void SetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj, ItemContainerStretchDirection value)
9292
{
93-
obj.SetValue(StretchItemContainerDirectionProperty, value);
93+
obj.SetValue(ItemContainerStretchDirectionProperty, value);
9494
}
9595

9696
private static void OnAlternateColorPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
@@ -166,7 +166,7 @@ private static void OnStretchItemContainerDirectionPropertyChanged(DependencyObj
166166
listViewBase.ContainerContentChanging -= StretchItemContainerDirectionChanging;
167167
listViewBase.Unloaded -= OnListViewBaseUnloaded;
168168

169-
if (StretchItemContainerDirectionProperty != null)
169+
if (ItemContainerStretchDirectionProperty != null)
170170
{
171171
listViewBase.ContainerContentChanging += StretchItemContainerDirectionChanging;
172172
listViewBase.Unloaded += OnListViewBaseUnloaded;
@@ -176,14 +176,14 @@ private static void OnStretchItemContainerDirectionPropertyChanged(DependencyObj
176176
private static void StretchItemContainerDirectionChanging(Windows.UI.Xaml.Controls.ListViewBase sender, ContainerContentChangingEventArgs args)
177177
{
178178
var itemContainer = args.ItemContainer as SelectorItem;
179-
var stretchDirection = GetStretchItemContainerDirection(sender);
179+
var stretchDirection = GetItemContainerStretchDirection(sender);
180180

181-
if (stretchDirection == StretchDirection.Vertical || stretchDirection == StretchDirection.Both)
181+
if (stretchDirection == ItemContainerStretchDirection.Vertical || stretchDirection == ItemContainerStretchDirection.Both)
182182
{
183183
itemContainer.VerticalContentAlignment = VerticalAlignment.Stretch;
184184
}
185185

186-
if (stretchDirection == StretchDirection.Horizontal || stretchDirection == StretchDirection.Both)
186+
if (stretchDirection == ItemContainerStretchDirection.Horizontal || stretchDirection == ItemContainerStretchDirection.Both)
187187
{
188188
itemContainer.HorizontalContentAlignment = HorizontalAlignment.Stretch;
189189
}

0 commit comments

Comments
 (0)