dirkster99 / avalondock Goto Github PK
View Code? Open in Web Editor NEWOur own development branch of the well known WPF document docking library
License: Microsoft Public License
Our own development branch of the well known WPF document docking library
License: Microsoft Public License
An anchorable can be dragged into a floating window position even though CanFloat=False is set on the LayoutAnchorable.
More details:
xceedsoftware/wpftoolkit#1551
As described in title, pressing Alt+F4 on floating mode hiding element even if CanHide is false.
xceedsoftware/wpftoolkit#1516
Avoid NullReferenceException() in DockingManager.GetFloatingWindowsByZOrder() by checking ctrl.Model.Root != null
before accessing Manager:
if( ctrl != null && ctrl.Model.Root != null && ctrl.Model.Root.Manager == this )
yield return ctrl;
paneModel.Children.Insert( Math.Min(paneModel.Children.Count, i), sourceModel );
Review Fix in this branch
https://github.com/Dirkster99/AvalonDock/tree/FloatingWindowCanHideFix
When invoking user actions in the order:
Hide Screen3 // LayoutAnchorable.Hide() Close Screen2 // LayoutAnchorable.Clolse() Show Screen3 // LayoutAnchorable.Show()
the Screen3 does not re-appear.
When invoking only steps 1 & 3 - the Screen3 appears as expected.
Sample project attached: Test-bug.zip
Hi Dirk,
this is not really an issue but more like a question. Not sure if you could help. I use the AvalonDock component in my MVVM application. Within the application I have bound my view models to the anchorable source like this:
<xcad:DockingManager Name="_dockingManager" Margin="5" Grid.Row="2" DataContext="{Binding DockingManagerViewModel}" DocumentsSource="{Binding Documents}" ActiveContent="{Binding Path=ActiveContent, Mode=TwoWay}" AnchorablesSource="{Binding Anchorables}">
So I can show new views dynamically by adding the corresponding model to the "Anchorables" collection. It is also possible to remove a view by removing the model from the collection. So the user can show and close views during the lifetime of the application. My problem is now - how can I store the last position of a view with the corresponding model to show it at the same place as before (in case a user shows a view, drags the view to another place and closes the view - after showing the view again, the view should appear on the last place as it was before). I know there is a layout load and save mechanism, but I want to store/restore location during the application lifetime. In addition the DockingManager itself has a LayoutChanged and LayoutChanging event which is also not really helpful in a MVVM application. Any ideas?
Implementations of IXmlSerializable.ReadXml are required to read the entire element from beginning to end, including all of its contents.
The current implementation would not read the end element from the reader. This cause issues if the LayoutRoot was being serialized as part of a parent object's xml serialization as the XmlReader would be left on an unexpected element.
Hi, I wonder how to set the controls menu language to Chinese without considering the language of my .Net framework?
Thank you!
Steps to reproduce:
Seems like these changes introduced the issue: f7427b7
If you save a layout that has a LayoutAnchorableFloatingWindow control maximized on a different screen and then you load it, the LayoutAnchorableFloatingWindow appears on the same screen as the MainWindow.
A Floating Window (Group with at least 2 tool windows) does not hide correctly.
The framework hides only the toolwindows but leaves floating window empty.
There is a NullReference Exception + Crash when user tries to drag the flowting tool window.
Drag 2 tool windows (LayoutAnchorable) into one floating window
Close MLib_Test Application to Save the Layout
Restart MLib_Test Application to Reload the Layout
Bug
Crash is reproducable with this layout but somehow not with above steps anymore(?):
Hi,
when attempting to deserialize a saved layout from XML, I get the following exception:
System.InvalidOperationException: 'Collection was modified; enumeration operation may not execute.'
It seems to be reproducable by moving or removing a LayoutAnchrablePane that is contained within the serialized layout and then deserializing the layout.
Here is the deserialization code:
var serializer = new XmlLayoutSerializer(dockingManager); serializer.LayoutSerializationCallback += SerializerLayoutSerializationCallback; [...] using (var stream = new StreamReader(defaultLayout)) { serializer.Deserialize(stream); }
(The exception is thrown somewhere inside serializer.Deserialize(stream);
)
StackTrace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Collections.Generic.List
1.Enumerator.MoveNext()
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 32
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 35
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 35
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 35
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 35
at Xceed.Wpf.AvalonDock.Layout.Extensions.d__0.MoveNext() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Extentions.cs:line 35
at System.Linq.Enumerable.d__951.MoveNext() at Xceed.Wpf.AvalonDock.DockingManager.Layout_ElementAdded(Object sender, LayoutElementEventArgs e) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\DockingManager.cs:line 2976 at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.OnLayoutElementAdded(LayoutElement element) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutRoot.cs:line 763 at Xceed.Wpf.AvalonDock.Layout.LayoutElement.OnRootChanged(ILayoutRoot oldRoot, ILayoutRoot newRoot) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutElement.cs:line 136 at Xceed.Wpf.AvalonDock.Layout.LayoutElement.set_Parent(ILayoutContainer value) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutElement.cs:line 68 at Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable.UpdateParentVisibility() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutAnchorable.cs:line 769 at Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable.OnParentChanged(ILayoutContainer oldValue, ILayoutContainer newValue) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutAnchorable.cs:line 270 at Xceed.Wpf.AvalonDock.Layout.LayoutElement.set_Parent(ILayoutContainer value) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutElement.cs:line 64 at Xceed.Wpf.AvalonDock.Layout.LayoutGroup
1._children_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutGroup.cs:line 253
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection
1.RemoveItem(Int32 index)
at System.Collections.ObjectModel.Collection1.Remove(T item) at Xceed.Wpf.AvalonDock.Layout.LayoutGroup
1.RemoveChild(ILayoutElement element) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutGroup.cs:line 137
at Xceed.Wpf.AvalonDock.DockingManager.DetachAnchorablesSource(LayoutRoot layout, IEnumerable anchorablesSource) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\DockingManager.cs:line 2917
at Xceed.Wpf.AvalonDock.DockingManager.OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayout) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\DockingManager.cs:line 147
at Xceed.Wpf.AvalonDock.DockingManager.OnLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\DockingManager.cs:line 127
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(TextReader reader) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Serialization\XmlLayoutSerializer.cs:line 82
at Alpine.Gui.TestSuite.TestSuiteWindow.LoadDefaultLayout(Object sender, RoutedEventArgs e) in D:#ATAT3\Alpine.Atat\src\Core\Alpine.Gui\TestSuite\TestSuiteWindow.xaml.cs:line 389
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
I added the layout I am trying to deserialize:
layout.zip
Kind Regards,
David
Greetings,
I am currently using version 3.5.12 with net4.8 and I discovered a new version of the old bug in version 3.5.0 with floating anchorables and saving layouts.
further down is the ExceptionWindo.xaml and cs file attached, in which you can reproduce this error.
The main key here is using two dockingManagers for two separate sections within TabControl although I think it can be done with other "Hiding" WPF elements.
To reproduce the error, you have to open this application. detach one of the windows to a floating anchorable and then save the layout. You switch tabs then load the layout (nothing should visually happen) and then switch back to the old tab. Now there is not one but two floating anchorables, and one points to a weirdly null reference.
Correct me, if I am saving these layouts wrong,
<Window 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:xcad="http://schemas.xceed.com/wpf/xaml/avalondock" x:Class="ExceptionWindow.ExceptionWindow"
mc:Ignorable="d"
Title="Exception Window" Height="800" Width="1200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button x:Name="LoadButton" Content="Load Layout" Grid.Row="0" Grid.Column="0" Click="LoadButton_Click"/>
<Button x:Name="SaveButton" Content="Save Layout" Grid.Row="0" Grid.Column="1" Click="SaveButton_Click"/>
<TabControl SelectedIndex="0" Grid.Row="1" Grid.ColumnSpan="2">
<TabItem Header="Tab 1">
<xcad:DockingManager x:Name="dockingManager1" AllowMixedOrientation="True">
<xcad:LayoutRoot>
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="40*">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable ContentId="Window1" Title="Window 1" CanHide="False" CanAutoHide="False" CanFloat="True">
<Grid></Grid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable ContentId="Window2" Title="Window 2" CanAutoHide="False" CanHide="True" CanClose="True">
<Grid></Grid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
<xcad:LayoutAnchorablePane DockWidth="60*">
<xcad:LayoutAnchorable ContentId="Window3" Title="Window 3" CanHide="True" CanAutoHide="False" CanClose="True">
<Grid></Grid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutPanel>
</xcad:LayoutRoot>
</xcad:DockingManager>
</TabItem>
<TabItem Header="Tab 2">
<xcad:DockingManager x:Name="dockingManager2" AllowMixedOrientation="True">
<xcad:LayoutRoot>
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePane DockWidth="25*">
<xcad:LayoutAnchorable CanClose="False" IsActive="True" CanHide="False" ContentId="Window4" Title="Window 4">
<Grid></Grid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorablePane DockWidth="75*">
<xcad:LayoutAnchorable CanClose="False" CanHide="False" CanAutoHide="False" ContentId="Window5" Title="Window 5">
<Grid></Grid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutPanel>
</xcad:LayoutRoot>
</xcad:DockingManager>
</TabItem>
</TabControl>
</Grid>
</Window>
using System.Windows;
using Xceed.Wpf.AvalonDock.Layout.Serialization;
namespace ExceptionWindow
{
/// <summary>
/// Interaction logic for FrmMain.xaml
/// </summary>
public partial class ExceptionWindow : Window
{
private XmlLayoutSerializer docking1LayoutSerializer;
private XmlLayoutSerializer docking2LayoutSerializer;
public ExceptionWindow()
{
//Initialize General UI
InitializeComponent();
docking1LayoutSerializer = new XmlLayoutSerializer(dockingManager1);
docking2LayoutSerializer = new XmlLayoutSerializer(dockingManager2);
}
private void LoadButton_Click(object sender, RoutedEventArgs e)
{
docking1LayoutSerializer.Deserialize("test-docking1.xml");
dockingManager1 = docking1LayoutSerializer.Manager;
docking2LayoutSerializer.Deserialize("test-docking2.xml");
dockingManager2 = docking2LayoutSerializer.Manager;
}
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
docking1LayoutSerializer.Serialize("test-docking1.xml");
docking2LayoutSerializer.Serialize("test-docking2.xml");
}
}
}
The AutoHide function does not work with controls that have a scrollviwer inside the controltemplate.
I have tested with MLibTest.
Step to reproduce:
Originally reported by https://github.com/striveprover
When switched our project from .Net framework 4.6.1 to 4.7.2, the ApplyStyleToLayoutItem routine in Xceed.Wpf.AvalonDock.DockingManager causes a ModelChange event. Handling the event requires that the new LayoutDocumentItem is in the DockingManager's _layoutItems list. Unfortunately, the new LayoutDocumentItem is only added after ApplyStyleToLayoutItem completes.
The handler for ModelChange event in LayoutDocumentTabItem fails to set LayoutItem property and its CloseCommand no longer executes. Also, the item appears blank. Deselecting and reselecting allows its content to show, but does not fix the CloseCommand.
To be clear, we switched the .Net framework only in our projects and not in the Avalon dock project.
The fix appears to be to re-order the two lines (in two places) in Xceed.Wpf.AvalonDock.DockingManager.cs as shown below.
_layoutItems.Add( layoutItem ); ApplyStyleToLayoutItem( layoutItem );
First of all thanks for the great work you did in your Avalon Dock branch. Currently I am using this implementation because of the fixed issues in your branch compared to the original Xceed branch. Now I am in a situation where I want to use some other controls from the original Xceed branch but the docking stuff from yours (some of my assemblies are still using the Nuget package from Xceed and one is using yours). All libraries are loaded via Nuget. Currently the assembly version is different 3.5.0.0 compared to 3.5.4.0 which is good but I think not really enough. Both assemblies have the same name which makes it impossible to do a xcopy deployment. Do you have a suggestions to handle this? I could compile your package myself and give the assembly a different name but then I loose all the advantages of Nuget.
Another error with a LayoutAnchorable.
If I Dock a LayoutAnchorabel Above or Below, or Left or Right of a LayoutDocument, it gets uncloseable. If I undock ("I can close the dialog") and dock completely to the left, right,... it works as excpected
Hi,
English is not my native language. Therefore, I apologize if I have not found a solution to my problem in closed issues. I'm not good at programming, so I don't know how to solve it.
I use VisualStudio 2017. I wanted to try AvalonDock, but unsuccessfully.
All Commits after "support netcore3" (Aug 31, 2019) report an error.
i use this code:
<avalondock:LayoutAnchorable x:Name="Tree" Title="Project Explorer" CanClose="False">
but it still shows the close button
Original Issue: #1481
I have an application using the AvalonDock library, and to fix an issue with new documents not showing content correctly (#1480), we have to set the IsActive property on the LayoutDocument to true in the BeforeInsertDocument method of the ILayoutUpdateStrategy implementation.
With this setup, the library throws a Null Reference Exception under these circumstances:
- Open enough new documents such that the tab headers fill the available width of the screen.
- The next document you open will be added at the start of the list instead of the end
- Click inside the document to give it focus
- Open another new document
- AvalonDock throws a Null Reference Exception
I have been able to produce a sample application that produces the same error; which is simply the DocumentOpenSample modified to set the IsActive property as described.
Hi,
Thank you for the great work. It has been a great help for my work with all the bug fixes.
I came across this issue in the Generic.xaml file of Xceed.Wpf.AvalonDock.Themes.VS2013, where the MenuItem for Close All Documents doesnt take the text from the Resources. Instead, it has a hard-coded "Document CloseAll". The functionality works perfectly fine, but it's missing the correct corresponding text.
Adding a screenshot of the source code.
Thank you once again.
Desired result: LayoutDocument element with ContentId sholud be kept between sessions.
In our application when we change the theme we have to reload the application layout. If we change the theme several times - we have the following exception:
System.InvalidOperationException: Cannot perform this operation while dispatcher processing is suspended.
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at Xceed.Wpf.AvalonDock.Controls.FocusElementManager.SetupFocusManagement(DockingManager manager)
at Xceed.Wpf.AvalonDock.DockingManager.DockingManager_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
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.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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
See this issue for the Problem: xceedsoftware/wpftoolkit#1195
Would it be Okay if I create a pull req for this?
Issue
My LayoutItemTemplateSelector SelectTemplate() method won't fire at all anymore.
Tried to change the TemplateSelector from a StaticResource to a Bindable object to pure XAML, but nothing worked. The ContentPresenter of a LayoutAnchorableControl is always a TextBlock.
Bug fix for xceedsoftware/wpftoolkit#1440
Replace 'Binding LayoutItem.View.Content' with 'Binding LayoutItem.View'
in Line 842 and 959 in generic.xaml
As shown in this commit:
fe18e81
We have a case when document panel becomes hidden outside of the window.
Please, check the attached video for more details:
AvalonDock_fixedAnchorablePanelBehavior.zip
Is there any way if we can make behavior of docked anchorable window in same way as in VisualStudio for example (see video).
Here in first order decrease Document Panel and then start to decreasing the tool panels.
So as told in subject, If I declare LayoutItemTemplate in DockingManager, it applies only for documents, but not for Anchorables.
nuget v 3.5
Hi
Firstly wanted to say this a great branch of AvalonDock and big thank you for your continued efforts on fixing issues developers have found with the WPF toolkit version.
I have a issue I'm hoping you might be able to resolve. My application is using entirely tool windows Layout Anchorables.
I'm currently on version 3.5.4.1 and I can now restore layout anchorable floating window on a second monitor, and also now as maximised on 2nd monitor :-)
However, when I group the floating layout anchorables together as a maximised layout anchorable group, I am unable to restore this back to the 2nd monitor.
Would you be able to provide an update that can restore floating layout anchorable group on a 2nd monitor please?
Thanks
Received following issue:
Top-level Exception Type: System.ArgumentOutOfRangeException Message: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source: mscorlib Stack Trace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List
1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection1.get_Item(Int32 index) at System.Collections.ObjectModel.ObservableCollection
1.MoveItem(Int32 oldIndex, Int32 newIndex)
at Xceed.Wpf.AvalonDock.Layout.LayoutGroup1.MoveChild(Int32 oldIndex, Int32 newIndex) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutGroup.cs:line 116 at Xceed.Wpf.AvalonDock.Controls.LayoutAnchorableTabItem.OnMouseEnter(MouseEventArgs e) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Controls\LayoutAnchorableTabItem.cs:line 189 at System.Windows.UIElement.OnMouseEnterThunk(Object sender, MouseEventArgs e)
Its a sporadic issue, which occurs when there is some load in our application.
We applied a hotfix with prechecking the indexes before executing containerPane.MoveChild
if (newindex < containerPane.ChildrenCount && oldIndex > -1) { containerPane.MoveChild(oldIndex, newindex); }
Hello,
Is there any plan to port AvalonDock to .Net Core 3 (which is WPF supported)?
Currently .Net Core 3 stage is preview6, and it will release at 2019/09.
I have tried to modify .sln and .csproj for .Net Core 3 by creating a whole new .Net Core 3 WPF library project with <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
(new format .csproj). It almost can be compiled perfectly, just only remove some Xceed related compiling/project parameters.
In other way, I have tried to use current .NET 4.6.1 version nuget dll to .Net Core 3 preview WPF Desktop project. It works!! Only the docking visual indicator pictures are shifted to right-down position, not on the center normally.
In fact, you can parallel compile two version DLLs for .Net Framework and .Net Core 3 by setting library .csproj with <TargetFrameworks>net461;netcoreapp3.0</TargetFrameworks>
.
Steps to reproduce:
Data Grid
the active tab by clicking on itFlow View
tab should be active but the Data Grid
is insteadI tested this with 3.5.0 (the version part of the Extended WPF Toolkit) and the same happens.
I've read this page but I did not find something useful.
The relevant part of the program, after the part which deserializes some XML with a changed layout:
var la = MyDockingManager.FindName("MyFlowViewAnchorable") as Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable;
Dispatcher.BeginInvoke(new Action(() =>
{
la.IsActive = true;
}));
No exception is thrown, no error is shown.
Thank you.
DockWidth and DockHeight Property do not working
And the symptoms are the same as the link below.
xceedsoftware/wpftoolkit#1297
The xaml structure of my project is as follows.
<LayoutDocumentPaneGroup DockWidth="200px">
<LayoutAnchorable/>
</LayoutDocumentPaneGroup>
<LayoutDocumentPaneGroup DockWidth="1*">
<LayoutAnchorable/>
</LayoutDocumentPaneGroup>
when LayoutDocumentPane or LayoutAnchorablePane contains more than 1 LayoutContent, click the header to switch LayoutContent serveral times quickly would get an exception
this bug also in LiveExplorer,Just click Alarms and Journal quickly, the LiveExplorer would get exception exit....
Using Windows 10 at set scaling factor to 300%
Load the demo application AvalonDock.MVVMTestApp and drag the document or toolwsind away:
Issue: The dragged content is displayed on the far left side and is sometimes invisible (off display) if the main window is positioned near the left border of the screen.
See also xceedsoftware/wpftoolkit#1357
Hello.
I am building a dashboard like solution with AvalonDock, it is using MVVM model to place UserControls inside LayoutContainers, one type attaches view from external application to create overlay in content area (win32.SetParent), i am using a simple code to get handle of the window:
var handle = new WindowInteropHelper(Window.GetWindow(this)).EnsureHandle();
While layout is docked it works fine, but once anchorable is undocked into floating mode things break down - how can i get float window handle so i can place overlay into that window ?
Secon issue: once floating window is moved there is no way to detect it via event ? I have looked into DockManager.LayoutUpdated but that updates only on layout changes, not window movement ?
I get the following error list when compiling in VS2017:
Severity Code Description Project File Line Suppression State
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Expression\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Expression.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock\bin\Debug\Xceed.Wpf.AvalonDock.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Aero\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Aero.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Metro\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Metro.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.VS2010\bin\Debug\Xceed.Wpf.AvalonDock.Themes.VS2010.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error CS0006 Metadata file 'E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.VS2013\bin\Debug\Xceed.Wpf.AvalonDock.Themes.VS2013.dll' could not be found WinFormsTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\WinFormsTestApp\CSC 1 Active
Error Error signing assembly -- Access is denied. Xceed.Wpf.AvalonDock E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock\ALINK
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 33 Position 4. Xceed.Wpf.AvalonDock.Themes.Aero E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Aero\Theme.xaml 33
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 32 Position 6. Xceed.Wpf.AvalonDock.Themes.Expression E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Expression\Theme.xaml 32
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 31 Position 4. Xceed.Wpf.AvalonDock.Themes.Metro E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.Metro\Theme.xaml 31
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 31 Position 4. Xceed.Wpf.AvalonDock.Themes.VS2010 E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.VS2010\Theme.xaml 31
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 34 Position 6. Xceed.Wpf.AvalonDock.Themes.VS2013 E:\Visual Studio 2017\Projects\AvalonDock-master\source\Components\Xceed.Wpf.AvalonDock.Themes.VS2013\Themes\Generic.xaml 34
Error The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock.Converters;assembly=Xceed.Wpf.AvalonDock'. Line 25 Position 14. MLibTest E:\Visual Studio 2017\Projects\AvalonDock-master\source\MLibTest\MLibTest\MainWindow.xaml 25
Error The tag 'DockingManager' does not exist in XML namespace 'clr-namespace:Xceed.Wpf.AvalonDock;assembly=Xceed.Wpf.AvalonDock'. Line 58 Position 10. MVVMTestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\MVVMTestApp\MainWindow.xaml 58
Error The tag 'DockingManager' does not exist in XML namespace 'http://schemas.xceed.com/wpf/xaml/avalondock'. Line 66 Position 10. TestApp E:\Visual Studio 2017\Projects\AvalonDock-master\source\TestApp\MainWindow.xaml 66
Error The tag 'DockingManager' does not exist in XML namespace 'http://schemas.xceed.com/wpf/xaml/avalondock'. Line 6 Position 6. Xceed.Wpf.AvalonDock.Test E:\Visual Studio 2017\Projects\AvalonDock-master\source\AutomationTest\Xceed.Wpf.AvalonDock.Test\Views\AnchorablePaneTestWindow.xaml 6
Error XDG0008 The name "DockingManager" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 66
Error XDG0008 The name "DockingManager" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 70
Error XDG0008 The name "LayoutRoot" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 78
Error XDG0008 The name "LayoutPanel" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 79
Error XDG0008 The name "LayoutAnchorablePane" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 80
Error XDG0008 The name "LayoutAnchorable" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 81
Error XDG0008 The name "LayoutDocumentPaneGroup" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 85
Error XDG0008 The name "LayoutDocumentPane" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 86
Error XDG0008 The name "LayoutDocument" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 87
Error XDG0008 The name "LayoutDocument" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 93
Error XDG0008 The name "LayoutAnchorablePaneGroup" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 98
Error XDG0008 The name "LayoutAnchorablePane" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 99
Error XDG0008 The name "LayoutAnchorable" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 100
Error XDG0008 The name "LayoutAnchorable" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 106
Error XDG0008 The name "LayoutRoot" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 113
Error XDG0008 The name "LayoutAnchorSide" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 114
Error XDG0008 The name "LayoutAnchorGroup" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 115
Error XDG0008 The name "LayoutAnchorable" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 116
Error XDG0008 The name "LayoutAnchorable" does not exist in the namespace "http://schemas.xceed.com/wpf/xaml/avalondock". TestApp MainWindow.xaml 119
Case A. LayoutFloatingWindowControl does not always update floating properties of child elements when its size was changed. Sometimes (like after setting LayoutFloatingWindowControl.SizeToContent property) it's necessary to reset them explicitely.
Steps to reproduce:
Case B. Currently AvalonDock does not inform application that uses this library about updates of FloatingHeight/FloatingWidth. So, it's not possible to correctly store these properties between sessions and restore them.
Steps to reproduce:
Hi, im using your fork of AD with restore layout as described in this article
While restoring layout, there is possibility that XML layout will contains reference to document which isnt open (while restoring) and in previous version AD ignored it and opened rest of layout.
But in 3.5.6 version it throws NullReferenceException (shown below).
In LayoutContent.cs when it comes to restore not existing document Root.Manager is null (as shown on screenshot)
Is there a possibility how to skip restoring documents which are not opened? For restoring layout im using code you wrote on codeproject.com (link in top of issue). Full code example described bellow. I thought, that when i set e.Cancel to true in LayoutSerializationCallback, then layout restoring for this document will be canceled. Or am i missing something?
private void LoadDockingManagerLayout(DockingManager docManager)
{
String layoutFileName = Path.Combine(LayoutDir, LayoutFileName);
layoutFileName = layoutFileName+ ".config";
if (!File.Exists(layoutFileName))
{
return;
}
var layoutSerializer = new XmlLayoutSerializer(docManager);
layoutSerializer.LayoutSerializationCallback += LayoutSerializer_LayoutSerializationCallback;
try
{
layoutSerializer.Deserialize(layoutFileName);
}
catch (Exception ex)
{
Console.WriteLine("AD Layout deserialization failed: " + ex.ToString());
//if loading layout fails, restore default layout
ResetLayout();
}
layoutSerializer.LayoutSerializationCallback -= LayoutSerializer_LayoutSerializationCallback;
}
private void LayoutSerializer_LayoutSerializationCallback(object sender, LayoutSerializationCallbackEventArgs e)
{
// This can happen if the previous session was loading a file
// but was unable to initialize the view ...
if (e.Model.ContentId == null)
{
e.Cancel = true;
return;
}
ReloadContentOnStartUp(e);
}
private void ReloadContentOnStartUp(LayoutSerializationCallbackEventArgs args)
{
string sId = args.Model.ContentId;
// Empty Ids are invalid but possible if aaplication is closed with File>New without edits.
if (string.IsNullOrWhiteSpace(sId) == true)
{
``` args.Cancel = true;
return;
}
args.Content = ReloadItem(args.Model);
if (args.Content == null) {
args.Cancel = true;
}
}
private object ReloadItem(object item)
{
object ret = null;
switch (item)
{
case LayoutAnchorable anchorable:
//list of tools windows
ret = Manager.Tools.FirstOrDefault(i => i.ContentId == anchorable.ContentId);
break;
case LayoutDocument document:
// list of restored documents
ret = Manager.Documents.FirstOrDefault(i => i.ContentId == document.ContentId);
break;
default:
throw new NotImplementedException("Not implemented type of AD item ");
}
return ret;
}
`System.NullReferenceException: Object reference not set to an instance of an object.
at Xceed.Wpf.AvalonDock.Layout.LayoutContent.CloseInternal() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutContent.cs:line 872
at Xceed.Wpf.AvalonDock.Layout.LayoutDocument.CloseDocument() in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutDocument.cs:line 181
at Xceed.Wpf.AvalonDock.Layout.Serialization.LayoutSerializer.FixupLayout(LayoutRoot layout) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Serialization\LayoutSerializer.cs:line 125
at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(TextReader reader) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Serialization\XmlLayoutSerializer.cs:line 82
at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(String filepath) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\Serialization\XmlLayoutSerializer.cs:line 110
at Skald.MVVM.QuestSystem.Controls.Docking.LayoutSaveLoadUtil.LoadDockingManagerLayout(DockingManager docManager) in C:\Workspaces\Skald_questSystemUI\Skald\MVVM\QuestSystem\Controls\Docking\LayoutSaveLoadUtil.cs:line 72`
Hello,
I launched the test project.
If a window is in autohide mode, it takes some noticeable time to hide when another window is clicked.
Thank you.
Steps to reproduce:
System.InvalidCastException: 'Unable to cast object of type 'Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable' to type 'Xceed.Wpf.AvalonDock.Layout.ILayoutPanelElement'.'
Other exception:
System.ArgumentOutOfRangeException: 'Index must be within the bounds of the List. Parameter name: index'
Is it possible to create a Preview Tab (on the right side?) in Avalondock?
It is not possible to setup anchorable in a way that dissallows user to drag/move it to the document pane.
Hi,
The LayoutAnchorable.CanDockAsTabbedDocument can be set to false to prevent the contextMenu from enabling the "Dock as Tabbed document" option.
But yes, a drag and drop is still possible. This will be fixed in v3.9.
A possible fix for this problem can be found in an extra branch:
https://github.com/Dirkster99/AvalonDock/tree/Issue18
I wonder if anyone has an opinion on this fix or whether I am missing something crucial? Would someone be up for a 4 eyes commit and independent testing?
First of all I think this is not a bug - but more a question.
I am looking for a way to define the anchor side within my view model:
<xcad:DockingManager Name="dock" Grid.Row="2"
DataContext="{Binding MyViewModel}"
DocumentsSource="{Binding Documents}"
AnchorablesSource="{Binding Anchorables}" >
Currently adding new view models to the "Anchorables" collection automatically shows up the new view on the right side. Is there a way to define the anchor side within the view model?
Hi,
I am using your fork of the AvalonDock framework (by the way - thanks for fixing all the annoying bugs :-)). Now when I undock a window to make it floating I can see a lot of flashing/flicker in the window title when I resize the window. Is it some wrong configuration on my side or is this the default behavior?
Dear Dirk
When i reload a layout where anchorables are docked in the documentpane and then hide a anchorable pane, then this pane cannot be show again.
I can reproduce the same behavior in your Edi project.
Close Edi
Nothing happens.
Kind Regards
Martin
Hello Dirkster,
maybe you could help me.
Can you tell me, how it is possible to Dock a new LayoutAnchorable in Code (not MVVM)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.