RadRibbonView - Setting IsMinimized in Style causing InvalidOperationException

3 posts, 0 answers
  1. Brian
    Brian avatar
    13 posts
    Member since:
    Jun 2009

    Posted 15 Oct 2014 Link to this post

    GOAL: Have the Ribbon start minimized or settable from my VM using state.

    The RadRibbonView is bound to a RadRichTextBox. I pretty much used the sample app for the template.

    I set the IsMinimized in the template and it crashed.

    Then I tried a style.

    <Style TargetType="{x:Type telerik:RadRichTextBoxRibbonUI}" BasedOn="{StaticResource {x:Type telerik:RadRichTextBoxRibbonUI}}">
            <Setter Property="IsMinimized" Value="true"/>
        </Style>


    Failed.

    Here is the crash.

       at System.Windows.Media.Visual.PointToScreen(Point point)
       at Telerik.Windows.Controls.RadRibbonView.SetPositionAndSizeToMinimizedContentPopup()
       at Telerik.Windows.Controls.RadRibbonView.ShowSelectedTab()
       at Telerik.Windows.Controls.RadRibbonView.<OnApplyTemplate>b__19()
       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)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at ProcedureViewerPOC.App.Main() in c:\TeamMate\dev\SeekfordPOCs\ProcedureViewerPOC\ProcedureViewerPOC\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1236 posts

    Posted 20 Oct 2014 Link to this post

    Hi,

    I tried to reproduce the reported behavior on our side with our latest official release and it seems that the code works as expected. Could you please take a look at the attached project and let me know if I missed something?

    Regards,
    Pavel R. Pavlov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Brian
    Brian avatar
    13 posts
    Member since:
    Jun 2009

    Posted 20 Oct 2014 Link to this post

    Thanks.

    Your demo helped me to search further. I ended up finding out it was due to me loading your controls in a splash screen to minimize the load time in the application(front loading). If I closed the splash screen too fast, your control threw exceptions. I put in a delay to make the load time a couple of seconds and it worked.

    Makes me wonder if your control will fail on any windows that are launched then very quickly dismissed.

    Anyway, I found a work around.
Back to Top