From b2b95a6f7a7a492b0d56573315eed937ef6302ce Mon Sep 17 00:00:00 2001 From: michael-hawker <24302614+michael-hawker@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:36:57 -0700 Subject: [PATCH 1/5] Add sample for FrameworkElementExtensions.Ancestor/Type --- .../FrameworkElementAncestorSample.xaml | 22 +++++++++++++++++++ .../FrameworkElementAncestorSample.xaml.cs | 17 ++++++++++++++ .../samples/FrameworkElementExtensions.md | 8 +++---- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 components/Extensions/samples/FrameworkElementAncestorSample.xaml create mode 100644 components/Extensions/samples/FrameworkElementAncestorSample.xaml.cs diff --git a/components/Extensions/samples/FrameworkElementAncestorSample.xaml b/components/Extensions/samples/FrameworkElementAncestorSample.xaml new file mode 100644 index 00000000..62322a79 --- /dev/null +++ b/components/Extensions/samples/FrameworkElementAncestorSample.xaml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/components/Extensions/samples/FrameworkElementAncestorSample.xaml.cs b/components/Extensions/samples/FrameworkElementAncestorSample.xaml.cs new file mode 100644 index 00000000..e8038428 --- /dev/null +++ b/components/Extensions/samples/FrameworkElementAncestorSample.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(FrameworkElementAncestorSample), nameof(FrameworkElementAncestorSample), description: $"A sample for showing how to use the FrameworkElementExtensions.Ancestor attached property.")] +public sealed partial class FrameworkElementAncestorSample : Page +{ + public FrameworkElementAncestorSample() + { + this.InitializeComponent(); + } +} diff --git a/components/Extensions/samples/FrameworkElementExtensions.md b/components/Extensions/samples/FrameworkElementExtensions.md index 6990a932..a6f9358a 100644 --- a/components/Extensions/samples/FrameworkElementExtensions.md +++ b/components/Extensions/samples/FrameworkElementExtensions.md @@ -102,11 +102,9 @@ The `AncestorType` attached property will walk the visual tree from the attached Here is an example of how this can be used: -```xaml -