This is a migrated thread and some comments may be shown as answers.

XBap RadWindow adorner error on startup

1 Answer 63 Views
Window
This is a migrated thread and some comments may be shown as answers.
Datafyer
Top achievements
Rank 1
Veteran
Datafyer asked on 14 Dec 2011, 09:16 PM
In an XBap application when a RadWindow is shown in the Application.StartUp event when there is no StartUri defined the RadWindow generates the exception listed. When the call to the RadWindow is removed or the StartUri is defined then the error goes away.

Version: 2011.3.1116.40 also tested with the latest internal build as of today.

<telerik:RadWindow x:Class="WpfBrowserApplication1.TestWindow"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" Header="TestWindow" Height="300" Width="300">
    <Grid Background="LightBlue">
        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
            Test
        </TextBlock>
    </Grid>
</telerik:RadWindow>

<Application x:Class="WpfBrowserApplication1.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Startup="Application_Startup" DispatcherUnhandledException="Application_DispatcherUnhandledException">
    <!-- StartupUri="Page1.xaml" -->
    <Application.Resources>
 
    </Application.Resources>
</Application>

using System.Windows;
 
namespace WpfBrowserApplication1
{
  using System;
 
  /// <summary>
  /// Interaction logic for App.xaml
  /// </summary>
  public partial class App : Application
  {
    public App()
    {
      AppDomain.CurrentDomain.UnhandledException += (s, a) => HandleError((Exception)a.ExceptionObject);
    }
 
    private object HandleError(Exception exception)
    {
      throw new NotImplementedException();
    }
 
    private void Application_Startup(object sender, StartupEventArgs e)
    {
      TestWindow newWindow = new TestWindow();
      newWindow.ShowDialog();
    }
 
    private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
    {
      Console.WriteLine();
    }
  }
}


Value cannot be null. Parameter name: adornedElement
   at System.Windows.Documents.Adorner..ctor(UIElement adornedElement)
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.WindowPopupAdorner..ctor(UIElement adornedElement, Panel contentPanel)
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.InitializeAdorner()
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.OnRootVisualLoaded(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.FrameworkElement.OnLoaded(RoutedEventArgs args)
   at MS.Internal.FrameworkObject.OnLoaded(RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedSynchronously(DependencyObject rootDO, Boolean isLoaded)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 Dec 2011, 09:55 AM
Hello Patrick,

The RadWindow control host itself in the Adorner area of the navigation window. Because of this you need to have a page loaded in your XBAP application in order the RadWindow to work correctly.

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Window
Asked by
Datafyer
Top achievements
Rank 1
Veteran
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or