Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The app crashes when I set CanTearOutTabs="True" on the TabView #10040

Open
ulvtro opened this issue Oct 7, 2024 · 5 comments
Open

The app crashes when I set CanTearOutTabs="True" on the TabView #10040

ulvtro opened this issue Oct 7, 2024 · 5 comments
Labels
needs-triage Issue needs to be triaged by the area owners

Comments

@ulvtro
Copy link

ulvtro commented Oct 7, 2024

Describe the bug

When I start the program and select one of the tabs, the program crashes.

Steps to reproduce the bug

Create a new project with "Blank App, Packaged (WinUI 3 in Desktop)".

Edit MainWindow.xaml like this:

<Grid>
   <TabView CanTearOutTabs="True">
      <TabViewItem Header="Test1" />
      <TabViewItem Header="Test2" />
      <TabViewItem Header="Test3" />
   </TabView>
</Grid>

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.6.1: 1.6.240923002

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 7, 2024
@ulvtro ulvtro changed the title TabView crashes when CanTearOutTabs="True" The app crashes when I set CanTearOutTabs="True" on the TabView Oct 7, 2024
@codendone codendone transferred this issue from microsoft/WindowsAppSDK Oct 8, 2024
@fabianoriccardi
Copy link

I can confirm this issue. When you start to drag a tab it crashes immediately.

@SoggyBottomBoy
Copy link

I've also encountered this.

@HotCakeX
Copy link

Same here, this crashes my entire app. My app runs as Admin but as stated by the doc, it is supported. so why the crash! Using latest version of Windows Apps SDK.

<TabView CanTearOutTabs="True">
    <TabView.TabItems>
        <TabViewItem Header="1">
            <TabViewItem.IconSource>
                <SymbolIconSource Symbol="Placeholder" />
            </TabViewItem.IconSource>
        </TabViewItem>
        <TabViewItem Header="2">
            <TabViewItem.IconSource>
                <SymbolIconSource Symbol="Placeholder" />
            </TabViewItem.IconSource>
        </TabViewItem>
    </TabView.TabItems>
</TabView>

Image

@michael-hawker
Copy link
Collaborator

You need to do more than just set the property to True. There are 4 other TearOut methods required to complete the experience. The first one creates the new Window, so I assume it's crashing when it doesn't have one, maybe?

We're demoing how to do this in the "What's New in WinUI and Windows App SDK 1.6" session tomorrow at .NET Conf.

In the meantime, see the sample update in the WinUI Gallery here: microsoft/WinUI-Gallery#1629

@DHancock
Copy link

DHancock commented Nov 13, 2024

FYI:

I'd used the changes in that gallery pull request to try out the tear off tabs feature, and while it was useful I did need to make a few changes to the code. The updated code is in the repro project attached to #10155 It may be worth taking a look.

If I remeber correctly the main problem was if you had two windows both containing tab views and in a single drag operation you tear out a tab from the first window. Then move the torn out window over the second windows tab headers (the torn out window closes and the tab is transfered to the second window's tab view). Then while still holding down the left mouse button continue dragging the tab out of the second window to create another tear out. That fails because the second window hasn't created that tear out window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

6 participants