项目结构调整

This commit is contained in:
艾竹
2023-04-16 20:11:40 +08:00
parent cbfbf96033
commit 81f91f3f35
2124 changed files with 218 additions and 5516 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Dragablz.Core;
namespace Dragablz
{
public class DefaultInterTabClient : IInterTabClient
{
public virtual INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
{
if (source == null) throw new ArgumentNullException("source");
var sourceWindow = Window.GetWindow(source);
if (sourceWindow == null) throw new ApplicationException("Unable to ascertain source window.");
var newWindow = (Window)Activator.CreateInstance(sourceWindow.GetType());
newWindow.Dispatcher.Invoke(new Action(() => { }), DispatcherPriority.DataBind);
var newTabablzControl = newWindow.LogicalTreeDepthFirstTraversal().OfType<TabablzControl>().FirstOrDefault();
if (newTabablzControl == null) throw new ApplicationException("Unable to ascertain tab control.");
if (newTabablzControl.ItemsSource == null)
newTabablzControl.Items.Clear();
return new NewTabHost<Window>(newWindow, newTabablzControl);
}
public virtual TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window)
{
return TabEmptiedResponse.CloseWindowOrLayoutBranch;
}
}
}