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

Expander + InkToolbar + Surface Dial crash #6915

Closed
1 of 2 tasks
SoundersFan opened this issue Mar 31, 2022 · 1 comment
Closed
1 of 2 tasks

Expander + InkToolbar + Surface Dial crash #6915

SoundersFan opened this issue Mar 31, 2022 · 1 comment

Comments

@SoundersFan
Copy link

Describe the bug

An Expander that contains an InkToolbar with custom button content crashes when a Surface Dial is used with it. But only before the expander is expanded.

Working solution that shows the problem where you will find the details of this bug report in the Readme.md file. The project links to Microsoft.UI.Xaml v2.7.1.

Steps to reproduce the bug

Prep:

  1. Pair a Surface Dial with your device.
  2. Build and Debug (F5) the app in VS2022 (2019 will probably work too)

Repro steps:

Note: do not expand the expander.

  1. Press and hold a Surface Dial that is paired to the system in order to bring up the tool selector menu.
  2. Rotate dial to highlight the Pen tool.
  3. Press Dial to select the Pen tool
  4. Press the Dial again. This should bring up the InkToolbar flyout.

Result:

App crashes, with exception:

The parameter is incorrect.
This element is already associated with a XamlRoot, it cannot be associated with a different one until it is removed from the previous XamlRoot."

Expected behavior

No crash

Screenshots

No response

NuGet package version

No response

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 11 (21H2): Build 22000

Additional context

Bug is happening with v2.7.1.

Counter examples:

If you perform the repro steps after first expanding the expander, the crash does not happen.

Replace the InkToolbar with any of the following declarations (which use built in button sets) and the issue is not reproduceable as there is no Pen tool available at step #2 in the repro steps.

<InkToolbar
    VerticalAlignment="Top"
    HorizontalAlignment="Right"
    TargetInkCanvas="{x:Bind Canvas}" />
<InkToolbar
    VerticalAlignment="Top"
    HorizontalAlignment="Right"
    TargetInkCanvas="{x:Bind Canvas}"
    InitialControls="PensOnly" />
<InkToolbar
    VerticalAlignment="Top"
    HorizontalAlignment="Right"
    TargetInkCanvas="{x:Bind Canvas}"
    InitialControls="None" />

Not sure if this is an Expander issue or a InkToolbar issue. Seems likely that it might be InkToolbar issue since I can modify the InkToolbar and issue goes away. Perhaps when you have custom buttons those buttons are being created too early, before the visuals have been rendered and positioned. As such, they have registered with Dial before they are capable of handling the messages the Dial will be sending them.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 31, 2022
@ojhad ojhad added team-Rendering Issue for the Rendering team area-InkToolBar labels Apr 7, 2022
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Dec 7, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants