-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96db2a7
commit 3f4f130
Showing
3 changed files
with
45 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.StretchItemContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
/// <summary> | ||
/// Provides attached dependency properties for the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> | ||
/// </summary> | ||
public static partial class ListViewExtensions | ||
{ | ||
/// <summary> | ||
/// Attached <see cref="DependencyProperty"/> for setting the container content stretch direction on the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> | ||
/// </summary> | ||
public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnItemContainerStretchDirectionPropertyChanged)); | ||
|
||
/// <summary> | ||
/// Gets the stretch <see cref="ItemContainerStretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> | ||
/// </summary> | ||
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to get the associated <see cref="ItemContainerStretchDirection"/> from</param> | ||
/// <returns>The <see cref="ItemContainerStretchDirection"/> associated with the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></returns> | ||
public static ItemContainerStretchDirection GetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj) | ||
{ | ||
return (ItemContainerStretchDirection)obj.GetValue(ItemContainerStretchDirectionProperty); | ||
} | ||
|
||
/// <summary> | ||
/// Sets the stretch <see cref="ItemContainerStretchDirection"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> | ||
/// </summary> | ||
/// <param name="obj">The <see cref="Windows.UI.Xaml.Controls.ListViewBase"/> to associate the <see cref="ItemContainerStretchDirection"/> with</param> | ||
/// <param name="value">The <see cref="ItemContainerStretchDirection"/> for binding to the <see cref="Windows.UI.Xaml.Controls.ListViewBase"/></param> | ||
public static void SetItemContainerStretchDirection(Windows.UI.Xaml.Controls.ListViewBase obj, ItemContainerStretchDirection value) | ||
{ | ||
obj.SetValue(ItemContainerStretchDirectionProperty, value); | ||
} | ||
} | ||
} |