Giter Club home page Giter Club logo

Comments (5)

kogare avatar kogare commented on August 22, 2024 1

Hi,
I add counter to count window it won't create multiple window with empty TabItem with this

        if (Application.Current.Windows.Count > 1)
        {
            return TabEmptiedResponse.CloseWindowOrLayoutBranch;
        }
        else
        {
            return TabEmptiedResponse.DoNothing;
        }

Thanks for the help

from dragablz.

ButchersBoy avatar ButchersBoy commented on August 22, 2024

There is already a hook provided so you can suppress this behaviour. You need to implement your own IInterTabClient and provide it via the InterTabController.

Something like:

<TabablzControl>
    <TabablzControl.InterTabController>
        <InterTabController InterTabClient="{Binding MyInterTabClient}">

By default, the DefaultInterTabClient client is used.

You can create your own, however to make things a little easier I have made the members on DefaultInterTabClient virtual (NuGet .102) so you can derive from that class if you want.

In your case, when you are programmatically removing items, you might need to temporarily adjust the TabEmptiedResponse, which will worked, as it is checked every-time. You may also be interested in IsClosingAsPartOfDragOperation which can help you distinguish when TabablzControl is closing the tab.

Hope this helps, gonna close this one.

from dragablz.

ButchersBoy avatar ButchersBoy commented on August 22, 2024

Hi Kogare, not quite sure what you're asking?

from dragablz.

kogare avatar kogare commented on August 22, 2024

I'm add that snippet in my override codes in TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window).
Because without that statement, when I tear TabItem and then close it, the window stay open unless I close the window explicitly. It becomes a problem when I tearing several TabItems and closing them, it makes multiple windows without any TabItem, so I add that code to tell apps to close the windows if there is more than one windows.

from dragablz.

ButchersBoy avatar ButchersBoy commented on August 22, 2024

ahhh, so you are happy, & everything's working? I wasn't sure if you were asking a further question. :)

As an aside, you might want to keep an eye on issue #15, as to help with that I might add another hook to help consolidate tabs.

from dragablz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.