microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

TeachingTip's close button doesn't work when binding Target to a control #8003

Closed JasonWei512 closed 1 year ago

JasonWei512 commented 1 year ago

Describe the bug

In Windows App SDK 1.2, if you bind TeachingTip's Target to a control, when you click TeachingTip's close button, it won't close.

Steps to reproduce the bug

Reproduction project: WinUITeachingTipBug.zip

  1. Bind TeachingTip's Target to a control
    
    <Grid x:Name="TestGrid" />

<TeachingTip CloseButtonContent="Close" Content="Click the close button, this TeachingTip won't close" IsOpen="True" Target="{x:Bind TestGrid}" />



2. Click the close button, and the TeachingTip won't close.

3. If you remove `Target="{x:Bind TestGrid}`, it will work again.
    If you downgrade Windows App SDK from 1.2.221116.1 to 1.1.5, it will also work again.

### Expected behavior

When clicking the close button, the TeachingTip should close.

### Screenshots

https://user-images.githubusercontent.com/16899918/202714318-11e5389d-6860-489b-a380-e44419792328.mp4

### NuGet package version

Windows App SDK 1.2.1: 1.2.221116.1

### Packaging type

Packaged (MSIX)

### Windows version

Windows 11 version 22H2 (22621, 2022 Update)

### IDE

Visual Studio 2022

### Additional context

_No response_
JasonWei512 commented 1 year ago

Duplicate of #7937