Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

DesktopWindowXamlSource window in taskbar in Windows10 while using WindowsXamlHostElement with CaptureElement #354

Open
1 task
Eugen00-00 opened this issue Mar 11, 2023 · 1 comment
Labels
bug 🐛 Something isn't working XamlIslands 🏝️

Comments

@Eugen00-00
Copy link

Describe the bug

I see DesktopWindowXamlSource window in taskbar in Windows10 after a dialog with WindowsXamlHostElement and CaptureElement as a WindowsXamlHostElement child is closed.
There is a test WPF application. Main window contains only a buttton that opens another dialog. This dialog has olny WindowsXamlHostElement

  <Grid>
        <xamlhost:WindowsXamlHost x:Name="XamlHost1" />
</Grid>

or with InitialTypeName (it makes no difference)

  <Grid>
        <xamlhost:WindowsXamlHost x:Name="XamlHost1" InitialTypeName="Windows.UI.Xaml.Controls.CaptureElement"/>
</Grid>

In the dialog constructor:
XamlHost1.Child = new CaptureElement();

Optionally it can be done (it makes no difference)

XamlHost1.ChildChanged += XamlHost_ChildChanged;
...
//closed event handler
 private void OnDialogClosed(object sender, EventArgs e)
        {
            XamlHost1.Child = null;
        }

       private void XamlHost_ChildChanged(object sender, EventArgs e)
        {
            var xh = sender as WindowsXamlHost;
            if(xh != null && !xh.IsDisposed)
            {
               xh.Dispose();
            }
        }

On button press the dialog appears, after dailog is closed one can see a DesktopWindowXamlSource window in taskbar.
It is reproducible on Windows10 22H2, but not reproducible on Windows11.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I don't want to see DesktopWindowXamlSource window in taskber after dialog is closed.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

NuGet Package(s): 
<packages>
  <package id="Microsoft.Toolkit.UI.XamlHost" version="6.1.2" targetFramework="net472" />
  <package id="Microsoft.Toolkit.Win32.UI.SDK" version="6.1.2" targetFramework="net472" />
  <package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.2" targetFramework="net472" />
  <package id="Microsoft.Toolkit.Wpf.UI.XamlHost" version="6.1.2" targetFramework="net472" />
  <package id="Microsoft.Windows.SDK.Contracts" version="10.0.18362.2005" targetFramework="net472" />
  <package id="System.Runtime.WindowsRuntime" version="4.6.0" targetFramework="net472" />
  <package id="System.Runtime.WindowsRuntime.UI.Xaml" version="4.6.0" targetFramework="net472" />
</packages>

Package Version(s): 
Microsoft.Toolkit.Wpf.UI.XamlHost v. 6.1.2
Microsoft.Windows.SDK.Contracts v. 10.0.18362.2005

Project .NET Version:
- [x ] .NET Framework (version:  4.7.2)
- [ ] .NET Core 3
- [ ] .NET Core 3.1 Preview (version: )

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (build number: )
- [ ] Windows10 22H2

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ x] 2019 (version: 16.11.24) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

@Eugen00-00 Eugen00-00 added the bug 🐛 Something isn't working label Mar 11, 2023
@ghost ghost added the needs triage 🔍 label Mar 11, 2023
@ghost
Copy link

ghost commented Mar 11, 2023

Hello Eugen00-00, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something isn't working XamlIslands 🏝️
Projects
None yet
Development

No branches or pull requests

2 participants