Skip to content

Commit

Permalink
Fixes #106 to change binding type of AncestorType in FrameworkElement…
Browse files Browse the repository at this point in the history
…Extensions.RelativeAncestor to FrameworkElement over DependencyObject

Code scoped to FrameworkElement in callback, so doesn't work with just DependencyObject as-is.
  • Loading branch information
michael-hawker authored and Arlodotexe committed Jul 11, 2023
1 parent 4332f85 commit 0a7b623
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace CommunityToolkit.WinUI;

/// <inheritdoc cref="FrameworkElementExtensions"/>
Expand Down Expand Up @@ -39,15 +37,15 @@ public static void SetAncestor(DependencyObject obj, object value)
/// Gets the Type of Ancestor to look for from this element.
/// </summary>
/// <returns>Type of Ancestor to look for from this element</returns>
public static Type GetAncestorType(DependencyObject obj)
public static Type GetAncestorType(FrameworkElement obj)
{
return (Type)obj.GetValue(AncestorTypeProperty);
}

/// <summary>
/// Sets the <see cref="Type"/> to look for from this element and place in the <see cref="AncestorProperty"/>.
/// </summary>
public static void SetAncestorType(DependencyObject obj, Type value)
public static void SetAncestorType(FrameworkElement obj, Type value)
{
obj.SetValue(AncestorTypeProperty, value);
}
Expand Down

0 comments on commit 0a7b623

Please sign in to comment.