Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow document to be docked in floating window. #107

Merged
merged 6 commits into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/Components/AvalonDock.Themes.Aero/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter Content="{Binding Model.RootDocument, RelativeSource={RelativeSource TemplatedParent}}"
<ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.DocumentTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" />

Expand All @@ -1351,7 +1351,7 @@
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
DropDownContextMenu="{Binding Model.Root.Manager.DocumentContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=RootDocumentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_CxMenu_Hint}">
<Image x:Name="PART_ImgPinMenu"
Stretch="None"
Expand Down Expand Up @@ -1395,7 +1395,7 @@
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
Command="{Binding Path=SingleContentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
Grid.Column="3">
<Image x:Name="PART_ImgPinClose"
Expand Down
6 changes: 3 additions & 3 deletions source/Components/AvalonDock.Themes.Expression/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Content="{Binding Model.RootDocument, RelativeSource={RelativeSource TemplatedParent}}"
<ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.DocumentTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"/>

Expand All @@ -907,7 +907,7 @@
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
DropDownContextMenu="{Binding Model.Root.Manager.DocumentContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=RootDocumentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_CxMenu_Hint}">
<Image x:Name="PART_ImgPinMenu" Stretch="None" Source="/AvalonDock.Themes.Expression;component/Images/PinMenu.png" Width="13"/>
</avalonDockControls:DropDownButton>
Expand Down Expand Up @@ -944,7 +944,7 @@
Focusable="False"
Style="{StaticResource AvalonDock_Expression_ButtonStyle}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
Command="{Binding Path=SingleContentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
Grid.Column="3">
<Image x:Name="PART_ImgPinClose" Source="/AvalonDock.Themes.Expression;component/Images/PinClose.png" Width="13" />
Expand Down
6 changes: 3 additions & 3 deletions source/Components/AvalonDock.Themes.Metro/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter Content="{Binding Model.RootDocument, RelativeSource={RelativeSource TemplatedParent}}"
<ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.DocumentTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" />

Expand All @@ -1409,7 +1409,7 @@
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
DropDownContextMenu="{Binding Model.Root.Manager.DocumentContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=RootDocumentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_CxMenu_Hint}">
<Image x:Name="PART_ImgPinMenu"
Stretch="None"
Expand Down Expand Up @@ -1453,7 +1453,7 @@
Focusable="False"
Style="{StaticResource AvalonDock_ThemeMetro_ButtonStyle}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
Command="{Binding Path=SingleContentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
Grid.Column="3">
<Image x:Name="PART_ImgPinClose"
Expand Down
6 changes: 3 additions & 3 deletions source/Components/AvalonDock.Themes.VS2010/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter Content="{Binding Model.RootDocument, RelativeSource={RelativeSource TemplatedParent}}"
<ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.DocumentTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" />

Expand All @@ -1491,7 +1491,7 @@
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
DropDownContextMenu="{Binding Model.Root.Manager.DocumentContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=RootDocumentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_CxMenu_Hint}">
<Image x:Name="PART_ImgPinMenu"
Stretch="None"
Expand Down Expand Up @@ -1535,7 +1535,7 @@
Focusable="False"
Style="{StaticResource AvalonDock_ThemeVS2010_ButtonStyle}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
Command="{Binding Path=SingleContentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
Grid.Column="3">
<Image x:Name="PART_ImgPinClose"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter Content="{Binding Model.RootDocument,
<ContentPresenter Content="{Binding Model.SinglePane.SelectedContent,
RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate,
RelativeSource={RelativeSource TemplatedParent}}"
Expand All @@ -1696,7 +1696,7 @@
VerticalContentAlignment="Center"
DropDownContextMenu="{Binding Model.Root.Manager.DocumentContextMenu,
RelativeSource={RelativeSource TemplatedParent}}"
DropDownContextMenuDataContext="{Binding Path=RootDocumentLayoutItem,
DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem,
RelativeSource={RelativeSource TemplatedParent}}"
Focusable="False"
Style="{StaticResource AvalonDockThemeVs2013ToolButtonStyle}"
Expand Down Expand Up @@ -1759,7 +1759,7 @@
Grid.Column="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand,
Command="{Binding Path=SingleContentLayoutItem.CloseCommand,
RelativeSource={RelativeSource TemplatedParent}}"
Focusable="False"
Style="{StaticResource AvalonDockThemeVs2013ButtonStyle}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@ protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)

public override System.Windows.Media.Geometry GetPreviewPath(OverlayWindow overlayWindow, LayoutFloatingWindow floatingWindowModel)
{
//var anchorablePaneDropTarget = target as AnchorablePaneDropTarget;
var anchorableFloatingWindowModel = floatingWindowModel as LayoutAnchorableFloatingWindow;
var layoutAnchorablePane = anchorableFloatingWindowModel.RootPanel as ILayoutPositionableElement;
var layoutAnchorablePaneWithActualSize = anchorableFloatingWindowModel.RootPanel as ILayoutPositionableElementWithActualSize;

switch (Type)
{
case DropTargetType.AnchorablePaneDockBottom:
Expand Down
Loading