// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Light C++/CX port of Microsoft.Toolkit.Uwp.UI.Extensions.VisualTree from the Windows Community toolkit
// Original version here:
// https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/VisualTree.cs
namespace Calculator::Utils
{
///
/// Defines a collection of extensions methods for UI.
///
ref class VisualTree sealed
{
///
/// Find descendant control using its name.
///
/// Parent element.
/// Name of the control to find
/// Descendant control or null if not found.
internal : static Windows::UI::Xaml::FrameworkElement ^ FindDescendantByName(Windows::UI::Xaml::DependencyObject ^ element, Platform::String ^ name);
///
/// Find first descendant control of a specified type.
///
/// Parent element.
/// Type of descendant.
/// Descendant control or null if not found.
static Windows::UI::Xaml::DependencyObject
^ FindDescendant(Windows::UI::Xaml::DependencyObject ^ element, Windows::UI::Xaml::Interop::TypeName typeName);
///
/// Find visual ascendant control using its name.
///
/// Parent element.
/// Name of the control to find
/// Descendant control or null if not found.
static Windows::UI::Xaml::FrameworkElement ^ FindAscendantByName(Windows::UI::Xaml::DependencyObject ^ element, Platform::String ^ name);
///
/// Find first visual ascendant control of a specified type.
///
/// Child element.
/// Type of ascendant to look for.
/// Ascendant control or null if not found.
static Platform::Object ^ FindAscendant(Windows::UI::Xaml::DependencyObject ^ element, Windows::UI::Xaml::Interop::TypeName type);
};
}