Comments (3)
Hi,
My initial reaction to this was "that's some kind of specialised behaviour that should be managed with the app", but after thinking this through, I can see the case for it, especially if you have TabablzControl.ShowDefaultCloseButton
turned off, which is the default starting position.
I'll have a little think about how to implement it. In the mean-time, there are enough hooks for you to do this yourself in some kind of tab contoller/window manager type set-up.
I'll draw your attention to a few hooks:
If TabablzControl.ShowDefaultCloseButton
is turned off and you want to allow only specific tabs to be close-able, you can implement a custom header (MVVM based) which contains a button using '''TabablzControl.CloseItemCommand'''. See CustomHeader.xaml example.
You would need a hook onto your windows. You can intercept Dragablz creation of new windows by implementing IInterTabClient
, and setting this property on the InterTabController
. There is a DefaultInterTabClient
which you can look at to get started. Also see this blog post.
Finally, you can check if a window is closing as part of a drag operation by inspecting the attached property TabablzControl.GetIsClosingAsPartOfDragOperation(Window)
. So, if this returns false inside a Window.Closing
event you could consider it a user driven close, pull the tabs, find another Window, and add them into that tab control.
from dragablz.
OK, implemented a new property and a new (optional) hook. TabablzControl.ConsolidateOrphanedItems
is your new friend. Setting this will cause tab items to move to another tab/window if a window is closed.
One caveat, is they appear next to the currently selected tab in the target window, and not on the end. But I have another issue open for this so when I look at that it should get resolved.
I've also provided ConsolidatingOrphanedItemCallback
. This will allow you to cancel the tab consolidation on a per tab basis. This would be useful have a you have some mandatory/fixed tabs, and some additional tabs that the user might open on demand.
I'll leave this issue open for a bit; let me know how you get on.
NuGet build 0.0.1.103.
from dragablz.
yes, I've seen, but I don't yet had time to test!
but thank you!!
from dragablz.
Related Issues (20)
- TabablzControl crashes when no tab items are present
- close button can't show HOT 1
- Dockablz layout does not show Dropzones when inside NavigationView
- Need to update SecondaryAccentBrush to SecondaryHueMidBrush
- Tabablz Item Template unable to set Tab title. Just shows as path to item template source HOT 1
- [Question] drag and drop between two or more lists HOT 2
- Documentation of classes
- MoveWindowWithSolitaryTabs issue
- TabablzControl SelectedIndex binding catches all exception from bound property
- Button in TabItem header
- is there a way to make dragablztabcontrol NOT TEARABLE?
- Layout: Cannot change FloatingItem Content
- How we can do this? : Open forms in different threads and then move the mainwindow all other forms must be move with them in wpf.
- MDI: New added floating item will not show at the front.
- .Net 7 Issue
- Throws System.Reflection.TargetInvocationException while dragging a tab when the tabs are created using ItemsSource.
- handling Default close button HOT 1
- Equal width for all tabs
- Brush renames on MaterialDesignInXAML 5.0.0 HOT 1
- Disposing closed tab
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dragablz.