MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / FindAscendant

Method FindAscendant

Xaml/RelativeAncestor.cpp:85–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 wux::DependencyObject RelativeAncestor::FindAscendant(const wux::DependencyObject &element, const wux::Interop::TypeName &type)
86 {
87 const auto parent = wux::Media::VisualTreeHelper::GetParent(element);
88
89 // IsAssignableFrom doesn't exist here but then the WCT also just checks the concrete type, so whatever.
90 if (!parent || get_class_name(parent) == type.Name)
91 {
92 return parent;
93 }
94 else
95 {
96 // haha recursive function go brrr
97 return FindAscendant(parent, type);
98 }
99 }
100
101 void RelativeAncestor::RemoveHandlers(const wux::FrameworkElement &element) noexcept
102 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected