XBap RadWindow adorner error on startup

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    55 posts
    Member since:
    Jun 2008

    Posted 14 Dec 2011 Link to this post

    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)
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top