public DocumentTabsProcessor(TabBar tabBar) { tabBar.HitTestTarget = true; this.tabBar = tabBar; DockManager.Instance.FilesDropped += DropFiles; RebuildTabs(tabBar); tabBar.AddChangeWatcher(() => Project.Current.Documents.Version, _ => RebuildTabs(tabBar)); tabBar.AddChangeWatcher(() => Project.Current, _ => RebuildTabs(tabBar)); }
public DocumentTabsProcessor(TabBar tabBar) { this.tabBar = tabBar; var g = new DropFilesGesture(); g.Recognized += new ScenesDropHandler { ShouldCreateContextMenu = false }.Handle; tabBar.Gestures.Add(g); tabBar.AllowReordering = true; RebuildTabs(); tabBar.OnReordered += args => Project.Current.ReorderDocument(Document.Current, args.IndexTo); tabBar.AddChangeWatcher(() => Project.Current.Documents.Version, _ => RebuildTabs()); tabBar.AddChangeWatcher(() => Project.Current, _ => RebuildTabs()); }