Skip to content

Setting the titlebar control back button visible through C# for the first time allows it to be dragged and removes animation #10350

@RyanLua

Description

@RyanLua

Describe the bug

When you set the TitleBar back button visible through C# (not XAML) the first time, it allows you to drag the window by the back button and removes the back button animation.

Steps to reproduce the bug

  1. Create a titlebar control in XAML with the back button IsBackButtonVisible false
  2. In the .xaml.cs file, set the IsBackButtonVisible to true
  3. Observe that you can drag the window by the back button and the animation is removed

Minimum reproduction:
https://github.com/RyanLua/TitlebarTest/tree/main/TitlebarTest

Expected behavior

Setting the back button in the titlebar control should retain the same behaviors as when setting it through XAML.

Screenshots

20250213-2248-11.1859949.mp4

NuGet package version

WinUI 3 - Windows App SDK 1.7 Preview 1: 1.7.250208002-preview1

Windows version

Windows 11 (24H2): Build 26100

Additional context

If you set the back button invisible and set it visible it again, it works like normal as expected. The first time you make the back button visible is when it is in this bugged state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TitleBarIssues related to custom window title bars.bugSomething isn't workingteam-ControlsIssue for the Controls team

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions