Fixed ListViewExtensionsCode.bind file.
This commit is contained in:
Родитель
dc5a00be1f
Коммит
354c7e3f60
|
@ -26,7 +26,7 @@
|
|||
ui:ListViewExtensions.Command="{Binding SampleCommand}"
|
||||
ui:ListViewExtensions.AlternateColor="#33AAAAAA"
|
||||
ui:ListViewExtensions.AlternateItemTemplate="{StaticResource AlternateTemplate}"
|
||||
ui:ListViewExtensions.StretchItemContainerDirection="Both">
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Both">
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -31,7 +31,7 @@ namespace Microsoft.Toolkit.Uwp.UI
|
|||
/// <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, OnStretchItemContainerDirectionPropertyChanged));
|
||||
public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnItemContainerStretchDirectionPropertyChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the alternate <see cref="Brush"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
|
||||
|
@ -154,7 +154,7 @@ namespace Microsoft.Toolkit.Uwp.UI
|
|||
}
|
||||
}
|
||||
|
||||
private static void OnStretchItemContainerDirectionPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
||||
private static void OnItemContainerStretchDirectionPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
Windows.UI.Xaml.Controls.ListViewBase listViewBase = sender as Windows.UI.Xaml.Controls.ListViewBase;
|
||||
|
||||
|
@ -163,17 +163,17 @@ namespace Microsoft.Toolkit.Uwp.UI
|
|||
return;
|
||||
}
|
||||
|
||||
listViewBase.ContainerContentChanging -= StretchItemContainerDirectionChanging;
|
||||
listViewBase.ContainerContentChanging -= ItemContainerStretchDirectionChanging;
|
||||
listViewBase.Unloaded -= OnListViewBaseUnloaded;
|
||||
|
||||
if (ItemContainerStretchDirectionProperty != null)
|
||||
{
|
||||
listViewBase.ContainerContentChanging += StretchItemContainerDirectionChanging;
|
||||
listViewBase.ContainerContentChanging += ItemContainerStretchDirectionChanging;
|
||||
listViewBase.Unloaded += OnListViewBaseUnloaded;
|
||||
}
|
||||
}
|
||||
|
||||
private static void StretchItemContainerDirectionChanging(Windows.UI.Xaml.Controls.ListViewBase sender, ContainerContentChangingEventArgs args)
|
||||
private static void ItemContainerStretchDirectionChanging(Windows.UI.Xaml.Controls.ListViewBase sender, ContainerContentChangingEventArgs args)
|
||||
{
|
||||
var itemContainer = args.ItemContainer as SelectorItem;
|
||||
var stretchDirection = GetItemContainerStretchDirection(sender);
|
||||
|
@ -194,7 +194,7 @@ namespace Microsoft.Toolkit.Uwp.UI
|
|||
Windows.UI.Xaml.Controls.ListViewBase listViewBase = sender as Windows.UI.Xaml.Controls.ListViewBase;
|
||||
_itemsForList.Remove(listViewBase.Items);
|
||||
|
||||
listViewBase.ContainerContentChanging -= StretchItemContainerDirectionChanging;
|
||||
listViewBase.ContainerContentChanging -= ItemContainerStretchDirectionChanging;
|
||||
listViewBase.ContainerContentChanging -= ItemTemplateContainerContentChanging;
|
||||
listViewBase.ContainerContentChanging -= ColorContainerContentChanging;
|
||||
listViewBase.Items.VectorChanged -= ColorItemsVectorChanged;
|
||||
|
|
Загрузка…
Ссылка в новой задаче