Skip to content

Commit ed27bed

Browse files
committed
Refactored the Visual/Logical tree extensions
1 parent aeff664 commit ed27bed

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/InAppNotification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected override void OnApplyTemplate()
7777
VisualStateManager.GoToState(this, StateContentVisible, true);
7878
}
7979

80-
AutomationProperties.SetLabeledBy(this, VisualTree.FindDescendant<ContentPresenter>(this));
80+
AutomationProperties.SetLabeledBy(this, this.FindDescendant<ContentPresenter>());
8181
}
8282

8383
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Render/MarkdownRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private void Preventative_PointerWheelChanged(object sender, Windows.UI.Xaml.Inp
214214
return;
215215
}
216216

217-
var rootViewer = VisualTree.FindAscendant<ScrollViewer>(RootElement);
217+
var rootViewer = RootElement.FindAscendant<ScrollViewer>();
218218
if (rootViewer != null)
219219
{
220220
pointerWheelChanged?.Invoke(rootViewer, new object[] { e });

Microsoft.Toolkit.Uwp.UI/Extensions/Tree/VisualTree.cs renamed to Microsoft.Toolkit.Uwp.UI/Extensions/DependencyObjectExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
#nullable enable
1212

13-
namespace Microsoft.Toolkit.Uwp.UI.Extensions
13+
namespace Microsoft.Toolkit.Uwp.UI
1414
{
1515
/// <summary>
16-
/// Defines a collection of extensions methods for UI.
16+
/// Provides attached dependency properties for the <see cref="DependencyObject"/> type.
1717
/// </summary>
18-
public static class VisualTree
18+
public static class DependencyObjectExtensions
1919
{
2020
/// <summary>
2121
/// Find the first descendant of type <see cref="FrameworkElement"/> with a given name, using a depth-first search.

Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs renamed to Microsoft.Toolkit.Uwp.UI/Extensions/FrameworkElement/FrameworkElementExtensions.LogicalTree.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212

1313
#nullable enable
1414

15-
namespace Microsoft.Toolkit.Uwp.UI.Extensions
15+
namespace Microsoft.Toolkit.Uwp.UI
1616
{
17-
/// <summary>
18-
/// Defines a collection of extensions methods for UI.
19-
/// </summary>
20-
public static class LogicalTree
17+
/// <inheritdoc cref="FrameworkElementExtensions"/>
18+
public static partial class FrameworkElementExtensions
2119
{
2220
/// <summary>
2321
/// Find the first child of type <see cref="FrameworkElement"/> with a given name, using a depth-first search.

0 commit comments

Comments
 (0)