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

Hide Window does not raise VisibilityChanged event #9696

Closed
qhy040404 opened this issue Jun 5, 2024 · 0 comments
Closed

Hide Window does not raise VisibilityChanged event #9696

qhy040404 opened this issue Jun 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@qhy040404
Copy link

Describe the bug

Call Window.Hide() does not raise VisibilityChanged event.

Steps to reproduce the bug

<Window
    x:Class="App.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid>
		<Button Text="Hide" Click="Button_Click"/>
	</Grid>
</Window>
public MainWindow()
{
    InitializeComponent();

	VisibilityChanged += (sender, e) =>
    {
        Debugger.Break();
    };
}

private void Button_Click(object sender, RoutedEventArgs e)
{
	this.Hide();
}

Expected behavior

After click the button, hit the breakpoint.

Screenshots

The debugger only breaks at the activation. Click the button will not pause the debugger.

NuGet package version

WinUI 3 - Windows App SDK 1.5.3: 1.5.240428000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@qhy040404 qhy040404 added the bug Something isn't working label Jun 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jun 5, 2024
@qhy040404 qhy040404 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage Issue needs to be triaged by the area owners label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant