Skip to content

Commit 2c04c96

Browse files
author
msftbot[bot]
authored
Fixed ListViewExtensionsCode.bind file. (#3850)
## Fixes #3849 ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more that apply to this PR. --> - Bugfix <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> - Sample app changes <!-- - Other... Please describe: --> ## What is the current behavior? ListViewExtensions sample is broken. ## What is the new behavior? ListViewExtensions sample app works. ## PR Checklist Please check if your PR fulfills the following requirements: - [ ] Tested code with current [supported SDKs](../readme.md#supported) - [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [ ] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets) - [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) - [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [X] Contains **NO** breaking changes <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->
2 parents 5462c5e + 8c1fa1a commit 2c04c96

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ListViewExtensions/ListViewExtensionsCode.bind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ui:ListViewExtensions.Command="{Binding SampleCommand}"
2727
ui:ListViewExtensions.AlternateColor="#33AAAAAA"
2828
ui:ListViewExtensions.AlternateItemTemplate="{StaticResource AlternateTemplate}"
29-
ui:ListViewExtensions.StretchItemContainerDirection="Both">
29+
ui:ListViewExtensions.ItemContainerStretchDirection="Both">
3030
</ListView>
3131
</Grid>
3232
</Page>

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

Lines changed: 6 additions & 6 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 ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnStretchItemContainerDirectionPropertyChanged));
34+
public static readonly DependencyProperty ItemContainerStretchDirectionProperty = DependencyProperty.RegisterAttached("ItemContainerStretchDirection", typeof(ItemContainerStretchDirection), typeof(ListViewExtensions), new PropertyMetadata(null, OnItemContainerStretchDirectionPropertyChanged));
3535

3636
/// <summary>
3737
/// Gets the alternate <see cref="Brush"/> associated with the specified <see cref="Windows.UI.Xaml.Controls.ListViewBase"/>
@@ -154,7 +154,7 @@ private static void ItemTemplateContainerContentChanging(Windows.UI.Xaml.Control
154154
}
155155
}
156156

157-
private static void OnStretchItemContainerDirectionPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
157+
private static void OnItemContainerStretchDirectionPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
158158
{
159159
Windows.UI.Xaml.Controls.ListViewBase listViewBase = sender as Windows.UI.Xaml.Controls.ListViewBase;
160160

@@ -163,17 +163,17 @@ private static void OnStretchItemContainerDirectionPropertyChanged(DependencyObj
163163
return;
164164
}
165165

166-
listViewBase.ContainerContentChanging -= StretchItemContainerDirectionChanging;
166+
listViewBase.ContainerContentChanging -= ItemContainerStretchDirectionChanging;
167167
listViewBase.Unloaded -= OnListViewBaseUnloaded;
168168

169169
if (ItemContainerStretchDirectionProperty != null)
170170
{
171-
listViewBase.ContainerContentChanging += StretchItemContainerDirectionChanging;
171+
listViewBase.ContainerContentChanging += ItemContainerStretchDirectionChanging;
172172
listViewBase.Unloaded += OnListViewBaseUnloaded;
173173
}
174174
}
175175

176-
private static void StretchItemContainerDirectionChanging(Windows.UI.Xaml.Controls.ListViewBase sender, ContainerContentChangingEventArgs args)
176+
private static void ItemContainerStretchDirectionChanging(Windows.UI.Xaml.Controls.ListViewBase sender, ContainerContentChangingEventArgs args)
177177
{
178178
var itemContainer = args.ItemContainer as SelectorItem;
179179
var stretchDirection = GetItemContainerStretchDirection(sender);
@@ -194,7 +194,7 @@ private static void OnListViewBaseUnloaded(object sender, RoutedEventArgs e)
194194
Windows.UI.Xaml.Controls.ListViewBase listViewBase = sender as Windows.UI.Xaml.Controls.ListViewBase;
195195
_itemsForList.Remove(listViewBase.Items);
196196

197-
listViewBase.ContainerContentChanging -= StretchItemContainerDirectionChanging;
197+
listViewBase.ContainerContentChanging -= ItemContainerStretchDirectionChanging;
198198
listViewBase.ContainerContentChanging -= ItemTemplateContainerContentChanging;
199199
listViewBase.ContainerContentChanging -= ColorContainerContentChanging;
200200
listViewBase.Items.VectorChanged -= ColorItemsVectorChanged;

0 commit comments

Comments
 (0)