From 4fc769eb67eb9870c7aee74576ada22330e7fc69 Mon Sep 17 00:00:00 2001 From: Arlo Date: Tue, 26 Nov 2024 18:39:01 -0600 Subject: [PATCH] Add sample for ListViewExtensions.AlternateColor property --- .../Extensions/samples/ListViewExtensions.md | 9 +------- ...istViewExtensionsAlternateColorSample.xaml | 21 +++++++++++++++++++ ...ViewExtensionsAlternateColorSample.xaml.cs | 17 +++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml create mode 100644 components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml.cs diff --git a/components/Extensions/samples/ListViewExtensions.md b/components/Extensions/samples/ListViewExtensions.md index 682cd597..877101e3 100644 --- a/components/Extensions/samples/ListViewExtensions.md +++ b/components/Extensions/samples/ListViewExtensions.md @@ -31,14 +31,7 @@ The `AlternateColor` property provides a way to assign a background color to eve Here is how this property can be used in XAML: -```xaml - - - -``` +> [!SAMPLE ListViewExtensionsAlternateColorSample] ## AlternateItemTemplate diff --git a/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml b/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml new file mode 100644 index 00000000..46f5fc41 --- /dev/null +++ b/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml @@ -0,0 +1,21 @@ + + + + + One + Two + Three + Four + Five + Six + Seven + Eight + Nine + Ten + + + diff --git a/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml.cs b/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml.cs new file mode 100644 index 00000000..20318e11 --- /dev/null +++ b/components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml.cs @@ -0,0 +1,17 @@ +// 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. + +namespace ExtensionsExperiment.Samples; + +/// +/// An empty page that can be used on its own or navigated to within a Frame. +/// +[ToolkitSample(id: nameof(ListViewExtensionsAlternateColorSample), nameof(ListViewExtensionsAlternateColorSample), description: $"A sample for showing how to use the ListViewExtensions.AlternateColor attached property.")] +public sealed partial class ListViewExtensionsAlternateColorSample : Page +{ + public ListViewExtensionsAlternateColorSample() + { + this.InitializeComponent(); + } +}