microsoft / microsoft/microsoft-ui-xaml

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

Open
#10,350 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-TitleBar bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

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

https://github.com/user-attachments/assets/1c566f04-33cd-499b-94a3-e0f919b04d8f

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the linked TitlebarTest minimum reproduction, starting with the titlebar XAML and its .xaml.cs code that toggles IsBackButtonVisible. Verify that first-time runtime visibility preserves the back button's drag behavior and animation, matching XAML initialization; done means the reported behavior no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.