This question is locked. New answers and comments are not allowed.
Here I'm conducting a test to see if I can have several UserControls that contain RADWindow to appear on my MainPage.
test.xaml contains a RADWindow:
test.cs contains window.show() method to show it.
Test2.xaml is also the same with different size.
Now on my MainPage, I placed two buttons to create these two UserControls and adds them to the LayoutRoot: (this is not production code, just a test)
Now when I run the app, I can only have one window show up at a time. If I try to open the second one while the first one is open, i get the following error:
--------------------------
"value does not fall within the expected range"
error details:
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, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.OpenWindow(Popup popup, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup, PopupType type, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup, PopupType type)
at Telerik.Windows.Controls.RadWindowPopup.WindowPopupSilverlightFactory.WindowPopupSilverlightImpl.Show()
at Telerik.Windows.Controls.RadWindowPopup.WindowPopupSilverlightFactory.WindowPopupSilverlightImpl.OpenPopup()
at Telerik.Windows.Controls.RadWindowPopup.WindowPopup.Open(Boolean isModal)
at Telerik.Windows.Controls.RadWindow.ShowWindow(Boolean modal)
at Telerik.Windows.Controls.RadWindow.Show()
at UniqueBrochure.Test2.Test2_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
--------------------------
Is there a way to have multiple Window show on MainPage that are in different UserControls rather than all being in one UserControl?
Thanks!
..Ben
test.xaml contains a RADWindow:
| <UserControl |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
| mc:Ignorable="d" |
| x:Class="UniqueBrochure.test" |
| d:DesignWidth="640" d:DesignHeight="480"> |
| <Grid x:Name="LayoutRoot"> |
| <telerikNavigation:RadWindow x:Name="window" Header="RadWindow" WindowStartupLocation="CenterOwner" Width="300" Height="300"/> |
| </Grid> |
| </UserControl> |
Test2.xaml is also the same with different size.
Now on my MainPage, I placed two buttons to create these two UserControls and adds them to the LayoutRoot: (this is not production code, just a test)
| private void Button_Click(object sender, System.Windows.RoutedEventArgs e) |
| { |
| test myTest=new test(); |
| this.LayoutRoot.Children.Add(myTest); |
| } |
| private void Button_Click2(object sender, System.Windows.RoutedEventArgs e) |
| { |
| Test2 myTest2=new Test2(); |
| this.LayoutRoot.Children.Add(myTest2); |
| } |
Now when I run the app, I can only have one window show up at a time. If I try to open the second one while the first one is open, i get the following error:
--------------------------
"value does not fall within the expected range"
error details:
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, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.OpenWindow(Popup popup, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup, PopupType type, Boolean attachToVisualRoot)
at Telerik.Windows.Controls.PopupManager.Open(Popup popup, PopupType type)
at Telerik.Windows.Controls.RadWindowPopup.WindowPopupSilverlightFactory.WindowPopupSilverlightImpl.Show()
at Telerik.Windows.Controls.RadWindowPopup.WindowPopupSilverlightFactory.WindowPopupSilverlightImpl.OpenPopup()
at Telerik.Windows.Controls.RadWindowPopup.WindowPopup.Open(Boolean isModal)
at Telerik.Windows.Controls.RadWindow.ShowWindow(Boolean modal)
at Telerik.Windows.Controls.RadWindow.Show()
at UniqueBrochure.Test2.Test2_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
--------------------------
Is there a way to have multiple Window show on MainPage that are in different UserControls rather than all being in one UserControl?
Thanks!
..Ben