Hi,
docking tool- and document- windows works fine in all scenarions except one:
see video below:
--- well, I don't know how I am supposed to attach a mp4 video file here ---
Neither cannot paste any image :(
in this scenario, the view model is not found. what is a reason of it?
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Ava.Actipro.BugDockedDocumentApp.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ava.Actipro.BugDockedDocumentApp.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="Ava.Actipro.BugDockedDocumentApp">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainWindowViewModel/>
</Design.DataContext>
<Window.Resources>
<ControlTheme x:Key="DocumentWindowTheme" x:DataType="vm:DocumentViewModel" TargetType="actipro:DocumentWindow" BasedOn="{StaticResource {x:Type actipro:DocumentWindow}}">
<!-- DockingWindow (BaseType) -->
<Setter Property="Description" Value="{Binding Description, Mode=TwoWay}" />
<Setter Property="Icon" Value="{Binding Icon, Mode=TwoWay}" />
<Setter Property="IsFloating" Value="{Binding IsFloating, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="SerializationId" Value="{Binding SerializationId, Mode=TwoWay}" />
<Setter Property="Title" Value="{Binding Title, Mode=TwoWay}" />
<Setter Property="WindowGroupName" Value="{Binding WindowGroupName, Mode=TwoWay}" />
<Setter Property="CanClose" Value="{Binding CanClose, Mode=TwoWay}" />
<Setter Property="CanFloat" Value="{Binding CanFloat, Mode=TwoWay}" />
<!-- IMPORTANT: These properties should be configured last so that other bindings are applied before the window opens -->
<Setter Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}" />
<Setter Property="IsOpen" Value="{Binding IsOpen, Mode=TwoWay}" />
</ControlTheme>
</Window.Resources>
<!-- NOTE: The implicit DataTemplates defined here should normally be placed in Application.Resources so that they will be found by floating windows -->
<Window.DataTemplates>
<DataTemplate DataType="{x:Type vm:DocumentAViewModel}">
<TextBox Text="This is Document A" Margin="5"/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:DocumentBViewModel}">
<TextBox Text="This is Document B" Margin="5"/>
</DataTemplate>
</Window.DataTemplates>
<actipro:DockSite x:Name="MainDockSite"
DocumentItemsSource="{Binding Documents}"
DocumentItemContainerTheme="{StaticResource DocumentWindowTheme}">
<actipro:SplitContainer Orientation="Horizontal">
<!-- Left panel with Node Library -->
<actipro:ToolWindowContainer MinWidth="112" MinHeight="0">
<actipro:ToolWindow Title="Node Library" ContainerDockedSize="286, 300">
<TextBox Text="Node Library" Margin="5"/>
</actipro:ToolWindow>
</actipro:ToolWindowContainer>
<!-- Main Workspace and Bottom Panel -->
<actipro:SplitContainer Orientation="Vertical">
<!-- Main Workspace -->
<actipro:Workspace>
<actipro:TabbedMdiHost/>
</actipro:Workspace>
<!-- Bottom panel with Node Info and Log Viewer -->
<actipro:ToolWindowContainer>
<!--<actipro:ToolWindow Title="Node Info"/>-->
<actipro:ToolWindow Title="Log Viewer">
<TextBox Text="Log Viewer" Margin="5"/>
</actipro:ToolWindow>
</actipro:ToolWindowContainer>
</actipro:SplitContainer>
</actipro:SplitContainer>
</actipro:DockSite>
</Window>
Suggestion:
maybe " <!-- NOTE: The implicit DataTemplates defined here should normally be placed in Application.Resources so that they will be found by floating windows -->" is the issue?
I tried to move the document templates to App, but it did not solve the problem.
I attach full source code of test app to easely repro the issue:
--- well, I don't know how I am supposed to attach a zip file here ---