System.Windows.Controls.Control または System.Windows.Controls.StackPanel のいずれかを返す関数が必要です。
理想的には、両方または両方の基本クラスによって実装されたインターフェースであるべきです(私はこの目的でオブジェクトを使用するのは嫌いです)
UIElement などのようなものは、そのうちの 1 つだけに限定されているようです。
何か案は?
System.Windows.Controls.Control または System.Windows.Controls.StackPanel のいずれかを返す関数が必要です。
理想的には、両方または両方の基本クラスによって実装されたインターフェースであるべきです(私はこの目的でオブジェクトを使用するのは嫌いです)
UIElement などのようなものは、そのうちの 1 つだけに限定されているようです。
何か案は?
FrameworkElementが唯一の賭けのようです。
FrameworkElementは両方に最も近い祖先ですが、それより上であれば問題ありません(UIElementを含む)。
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Panel
System.Windows.Controls.StackPanel
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control