I have PopUpControl that on button click shows RadWindow. Content of RadWindow is PopUpWindow. I dynamically load PopUpWindow content which in turn can contains PopUpControl.
First popup displays fine, however on nested popup I get following exception:
System.ArgumentException was unhandled by user code
Message="Value does not fall within the expected range."
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_InsertValue[T](PresentationFrameworkCollection`1 collection, UInt32 index, CValue value)
at MS.Internal.XcpImports.Collection_InsertDependencyObject[T](PresentationFrameworkCollection`1 collection, UInt32 index, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Insert(Int32 index, T value)
at Telerik.Windows.Controls.HACKS.AttachPopupToVisualTree(Popup popup)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup)
at Telerik.Windows.Controls.PopupManager.OpenWindow(Popup popup)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup, PopupType type)
at Telerik.Windows.Controls.RadWindow.ShowWindow()
at Telerik.Windows.Controls.RadWindow.Show()
at RadWindowPopup.PopupControl.ShowPopup_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
InnerException:
I have small project that recreates this problem.
Is there a workaround for this issue?