这是indexloc提供的服务,不要输入任何密码
Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private void OnExecuteHideWindowCommand( object parameter )
var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem;
anchorableLayoutItem.HideCommand.Execute( parameter );
}

Hide(); // Bring toolwindows inside hidden FloatingWindow back requires restart of app
}
#endregion

Expand Down
22 changes: 12 additions & 10 deletions source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2069,16 +2069,18 @@ internal UIElement CreateUIElementForModel( ILayoutElement model )
};
newFW.SetParentToMainWindowOf( this );

var paneForExtensions = modelFW.RootPanel.Children.OfType<LayoutAnchorablePane>().FirstOrDefault();
if( paneForExtensions != null )
// Floating Window can also contain only Pane Groups at its base (issue #27) so we check for
// RootPanel (which is a LayoutAnchorablePaneGroup) and make sure the window is positioned back
// in current (or nearest) monitor
var panegroup = modelFW.RootPanel;
if (panegroup != null)
{
//ensure that floating window position is inside current (or nearest) monitor
paneForExtensions.KeepInsideNearestMonitor();
panegroup.KeepInsideNearestMonitor(); // Check position is valid in current setup

newFW.Left = paneForExtensions.FloatingLeft;
newFW.Top = paneForExtensions.FloatingTop;
newFW.Width = paneForExtensions.FloatingWidth;
newFW.Height = paneForExtensions.FloatingHeight;
newFW.Left = panegroup.FloatingLeft; // Position the window to previous or nearest valid position
newFW.Top = panegroup.FloatingTop;
newFW.Width = panegroup.FloatingWidth;
newFW.Height = panegroup.FloatingHeight;
}

newFW.ShowInTaskbar = false;
Expand All @@ -2088,11 +2090,11 @@ internal UIElement CreateUIElementForModel( ILayoutElement model )
newFW.Show();
} ), DispatcherPriority.Send );

// Do not set the WindowState before showing or it will be lost
if( paneForExtensions != null && paneForExtensions.IsMaximized )
if( panegroup != null && panegroup.IsMaximized )
{
newFW.WindowState = WindowState.Maximized;
}

return newFW;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,14 @@ private void NotifyIsVisibleChanged()

private void UpdateParentVisibility()
{
// Element is Hidden since it has no parent but a previous parent
if (this.PreviousContainer != null && Parent == null)
{
// Go back to using previous parent
Parent = PreviousContainer;
//// PreviousContainer = null;
}

var parentPane = Parent as ILayoutElementWithVisibility;
if( parentPane != null )
parentPane.ComputeVisibility();
Expand Down
2 changes: 2 additions & 0 deletions source/MLibTest/MLibTest/Demos/PanesTemplateSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public PanesTemplateSelector()
/// </summary>
public DataTemplate ColorPickerViewTemplate { get; set; }

public DataTemplate Tooln_ViewTemplate { get; set; }

/// <summary>
/// Gets a template for simple testing tool windows.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ internal class WorkSpaceViewModel : MLibTest.ViewModels.Base.ViewModelBase, IWor
private Tool3_ViewModel _Tool3;

private FileViewModel _activeDocument = null;
private Tool1_ViewModel _Tool1;
private Tool2_ViewModel _Tool2;
private Tool3_ViewModel _Tool3;
#endregion private fields

#region constructors
Expand Down Expand Up @@ -167,7 +170,8 @@ public IEnumerable<ToolViewModel> Tools
get
{
if (_tools == null)
_tools = new ToolViewModel[] { FileStats, ColorPicker, Tool1, Tool2, Tool3 };
_tools = new ToolViewModel[] { FileStats, ColorPicker, _Tool1, _Tool2, _Tool3 };

return _tools;
}
}
Expand Down
8 changes: 7 additions & 1 deletion source/MLibTest/MLibTest/MLibTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down Expand Up @@ -81,9 +81,14 @@
<Compile Include="Demos\LayoutInitializer.cs" />
<Compile Include="Demos\PanesStyleSelector.cs" />
<Compile Include="Demos\PanesTemplateSelector.cs" />
<Compile Include="Demos\ViewModels\Tools\Tool2_ViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\Tool3_ViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\Tool1_ViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\FileStatsViewModel.cs" />
<Compile Include="Demos\ViewModels\AD\FileViewModel.cs" />
<Compile Include="Demos\ViewModels\AD\PaneViewModel.cs" />
<Compile Include="Demos\ViewModels\AD\ToolViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\ColorPickerViewModel.cs" />
<Compile Include="Demos\ViewModels\Interfaces\IWorkSpaceViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\ColorPickerViewModel.cs" />
<Compile Include="Demos\ViewModels\Tools\FileStatsViewModel.cs" />
Expand Down Expand Up @@ -193,5 +198,6 @@
<ItemGroup>
<Resource Include="Demos\Images\property-blue.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>