Skip to content

Commit 0a7b623

Browse files
michael-hawkerArlodotexe
authored andcommitted
Fixes #106 to change binding type of AncestorType in FrameworkElementExtensions.RelativeAncestor to FrameworkElement over DependencyObject
Code scoped to FrameworkElement in callback, so doesn't work with just DependencyObject as-is.
1 parent 4332f85 commit 0a7b623

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/Extensions/src/Element/FrameworkElementExtensions.RelativeAncestor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
6-
75
namespace CommunityToolkit.WinUI;
86

97
/// <inheritdoc cref="FrameworkElementExtensions"/>
@@ -39,15 +37,15 @@ public static void SetAncestor(DependencyObject obj, object value)
3937
/// Gets the Type of Ancestor to look for from this element.
4038
/// </summary>
4139
/// <returns>Type of Ancestor to look for from this element</returns>
42-
public static Type GetAncestorType(DependencyObject obj)
40+
public static Type GetAncestorType(FrameworkElement obj)
4341
{
4442
return (Type)obj.GetValue(AncestorTypeProperty);
4543
}
4644

4745
/// <summary>
4846
/// Sets the <see cref="Type"/> to look for from this element and place in the <see cref="AncestorProperty"/>.
4947
/// </summary>
50-
public static void SetAncestorType(DependencyObject obj, Type value)
48+
public static void SetAncestorType(FrameworkElement obj, Type value)
5149
{
5250
obj.SetValue(AncestorTypeProperty, value);
5351
}

0 commit comments

Comments
 (0)