This project is read-only.

Error occurs in Vista but not XP in latest version.

Aug 1, 2008 at 10:30 PM
Upgrading from version 1.1.1106 to 1.1.1231 is causing an error when running in Vista. In XP everything is fine with both versions. But 1.1.1231 is throwing the following exception in Vista..

System.InvalidOperationException was unhandled

  Message="Dispatcher processing has been suspended, but messages are still being processed."

  Source="WindowsBase"

  StackTrace:

       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, Boolean isSingleParameter)

       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)

       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)

       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

       at Microsoft.Win32.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type)

       at System.Diagnostics.AssertWrapper.ShowMessageBoxAssert(String stackTrace, String message, String detailMessage)

       at System.Diagnostics.DefaultTraceListener.Fail(String message, String detailMessage)

       at System.Diagnostics.DefaultTraceListener.Fail(String message)

       at System.Diagnostics.TraceInternal.Fail(String message)

       at System.Diagnostics.TraceInternal.Assert(Boolean condition)

       at System.Diagnostics.Debug.Assert(Boolean condition)

       at AvalonDock.ResizingPanel.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at AvalonDock.ResizingPanel.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)

       at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)

       at AvalonDock.DockingManager.ArrangeOverride(Size arrangeBounds)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)

       at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)

       at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)

       at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Decorator.ArrangeOverride(Size arrangeSize)

       at System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Window.ArrangeOverride(Size arrangeBounds)

       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

       at System.Windows.UIElement.Arrange(Rect finalRect)

       at System.Windows.Interop.HwndSource.SetLayoutSize()

       at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)

       at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)

       at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)

       at System.Windows.Window.CreateSourceWindowImpl()

       at System.Windows.Window.SafeCreateWindow()

       at System.Windows.Window.ShowHelper(Object booleanBox)

       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)

       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

       at System.Windows.Threading.DispatcherOperation.InvokeImpl()

       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

       at System.Threading.ExecutionContext.runTryCode(Object userData)

       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

       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, Boolean isSingleParameter)

       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)

       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)

       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.RunInternal(Window window)

       at System.Windows.Application.Run(Window window)

       at System.Windows.Application.Run()

       at MetrixStudio.App.Main() in C:\M510\Studio\MetrixStudio\obj\Debug\App.g.cs:line 0

       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)

       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)

       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()

       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)

       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)

       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()

       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Threading.ThreadHelper.ThreadStart()

Aug 7, 2008 at 9:09 AM

As I can see from stack trace, there is an assertion that fails in the AvalonDock.ResizingPanel.ArrangeOverride(Size finalSize).

I tested latest version  1.1.1501 with Vista and it seems to work fine. Can you give more details on how to get this exception?

Aug 7, 2008 at 2:09 PM
It happens during the application load. Before I actually do anything. One thing... the DLL I am using is a minor mod from the released version. I took the source code and just changed a few of the application resources to change some of the colors. That's it. I could send you the source code.
Aug 7, 2008 at 3:35 PM
Tried the compiled 1.1.1501 dll that comes in the MSI and it works in Vista. Is there any way to change the color of the tabs and the blue focus color on DocumentPanel without have to go into the source and re-compile?

Thanks,
Rod
Aug 7, 2008 at 4:01 PM
At the moment you can change without restyling only the color of a dockablepane when focus is within, the brush name is "DockablePaneTitleBackground" that by default is:
<LinearGradientBrush x:Key="DockablePaneTitleBackground"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FF3B80ED"
                          Offset="0"/>
            <GradientStop Color="#FF316AC5"
                          Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

To change colors of tabs with this version you need to restyle the control. In future releases much more color options will be avilable.
Ado

(*Download build 1501 which is faster under Vista)
Aug 7, 2008 at 7:17 PM
So using the compiled dll that comes with the install, it works in Vista. If I change some of the style colors in the resource files, it breaks again in Vista.

I have changed some of the colors in the following files...
Brushes.xaml
DockablePaneStyles.xaml
DocumentPaneStyles.xaml
DockingManagerStyles.xaml

If you would like, I could send you these modified files so that you can see the exception occur.

Thanks.
Aug 7, 2008 at 9:22 PM
One recent note...

I just handed this modified project over to my Vista guy and the project debugs fine using the AvalonDockTest. The compiled version of it fails in our project.

Here is our dock layout xaml...

Windows.Resources

<

 

Style TargetType="{x:Type ad:DocumentPane}">

 

<

 

Setter Property="Template">

 

<

 

Setter.Value>

 

<

 

ControlTemplate TargetType="{x:Type ad:DocumentPane}" >

 

<

 

ContentPresenter Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Content}" Margin="2" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="1"/>

 

<

 

ControlTemplate.Triggers>

 

<

 

EventTrigger RoutedEvent="Window.Loaded">

 

<

 

BeginStoryboard>

 

<

 

Storyboard>

 

<

 

DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.200" />

 

</

 

Storyboard>

 

</

 

BeginStoryboard>

 

</

 

EventTrigger>

 

</

 

ControlTemplate.Triggers>

 

</

 

ControlTemplate>

 

</

 

Setter.Value>

 

</

 

Setter>

 

</

 

Style>

 

End Windows.Resources

<

 

TabItem Style="{DynamicResource XpTabItemStyle}" Foreground="White" Background="{StaticResource StudioDefaultBackground}" Header="Screen Configurator" Width="Auto" Height="Auto" Margin="0,0,0,0" x:Name="ScreenConfigTab">

 

<

 

ad:DockingManager x:Name="_dockingManager">

 

<

 

ad:ResizingPanel Orientation="Vertical">

 

<

 

ad:ResizingPanel Orientation="Horizontal">

 

<

 

ad:DockablePane ad:ResizingPanel.ResizeWidth="250" ad:ResizingPanel.ResizeHeight="100">

 

<

 

ad:DockableContent x:Name="_propertiesWindow" Title="Properties" IconSource="..\..\images\table_properties_16.png">

 

<

 

Grid Background="{StaticResource StudioDefaultBackground}" Margin="5,5,5,5">

 

<

 

Grid.RowDefinitions>

 

<

 

RowDefinition/>

 

<

 

RowDefinition/>

 

</

 

Grid.RowDefinitions>

 

<

 

ListView Background="{StaticResource StudioDefaultBackground}" Margin="5,10,5,0" Grid.Row="0" x:Name="_propertiesList"/>

 

<

 

ListView Background="{StaticResource StudioDefaultBackground}" Margin="5,10,5,10" Grid.Row="1" x:Name="_serverPropertiesList"/>

 

</

 

Grid>

 

</

 

ad:DockableContent>

 

<

 

ad:DockableContent x:Name="_screenListWindow" Title="Screen Explorer" IconSource="..\..\images\form.png">

 

<

 

TreeView x:Name="_screensList" Margin="5,5,5,5" Width="Auto" Height="Auto">

 

<

 

TreeView.ItemTemplate>

 

<

 

HierarchicalDataTemplate ItemsSource="{Binding XPath=ms_screen|cs_screen}">

 

<

 

TextBlock Text="{Binding XPath=screen_name}"/>

 

<

 

HierarchicalDataTemplate.ItemTemplate>

 

<

 

DataTemplate>

 

<

 

TextBlock Text="{Binding XPath=customization_name}"/>

 

</

 

DataTemplate>

 

</

 

HierarchicalDataTemplate.ItemTemplate>

 

</

 

HierarchicalDataTemplate>

 

</

 

TreeView.ItemTemplate>

 

</

 

TreeView>

 

</

 

ad:DockableContent>

 

</

 

ad:DockablePane>

 

<

 

ad:DocumentPane x:Name="_layoutHost">

 

<

 

ad:DocumentContent x:Name="_layoutDocContent" Title="Layout" ContentTypeDescription="Metadata document">

 

<

 

ScrollViewer Background="{StaticResource StudioDefaultBackground}" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

 

<

 

Grid Background="{StaticResource StudioDefaultBackground}" x:Name="LayoutHolder"/>

 

</

 

ScrollViewer>

 

</

 

ad:DocumentContent>

 

</

 

ad:DocumentPane>

 

</

 

ad:ResizingPanel>

 

</

 

ad:ResizingPanel>

 

</

 

ad:DockingManager>

 

</

 

TabItem>

 

Aug 8, 2008 at 3:24 PM
This stuff works fine also on my system XP with AvalonDockTest. Probabily there is something wrong on your edited resources. Is the exception always the same? I mean Debug.Assert() fails in ResinzingPanel.ArrangeOverride()?
Have you tested your edited files
Brushes.xaml
DockablePaneStyles.xaml
DocumentPaneStyles.xaml
DockingManagerStyles.xaml
with AvalonDockTest?
Just an hint, don't edit AvalonDock default styles, but create your own styles and put them in your application.resources, so should be easier to understand problems when occur.

Ado

PS: If you post xaml please remove the VS coloring so I can copy and paste directly on my project,
Aug 8, 2008 at 8:25 PM

Can you give me an example (what to put in my application.resources) showing how to to change the color of the dockablepane when it is focused? It currently turns to blue. I want it to be orange.

 

Thanks

Aug 13, 2008 at 11:37 PM

Thanks for pointing us to the Debug.Assert() in ResizingPanel.ArrangeOverride(), that was the cause.  We built a release build with our customizations and pointed our project at that instead of the debug build, and it now works on Vista.

Jon, the "Vista Guy"