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

Shadows overview sample in gallery crashes under Windows App SDK #512

Open
1 of 24 tasks
Arlodotexe opened this issue Sep 18, 2024 · 3 comments
Open
1 of 24 tasks

Shadows overview sample in gallery crashes under Windows App SDK #512

Arlodotexe opened this issue Sep 18, 2024 · 3 comments
Assignees
Labels
blocked Blocked bug Something isn't working regression What was working is now broke sample app 🖼️

Comments

@Arlodotexe
Copy link
Member

Arlodotexe commented Sep 18, 2024

Describe the bug

When running the gallery with the Wasdk head on the latest main commit, the 'Shadows overview' sample will crash the app:
image

Exception message:

Specified cast is not valid.

Stack trace:

   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(IObjectReference _obj, Size availableSize)
   at Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)

This behavior is not present when running the gallery under UWP.

Steps to reproduce

1. Clone the repo
2. Generate the gallery solution, include the Media component and the wasdk multitarget/head.
3. Build and deploy the wasdk gallery 
4. Navigate to the 'Shadows overview' sample page and observe crash.

Expected behavior

No crash

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

@Arlodotexe
Copy link
Member Author

This error only throws when AoT is enabled. Running without AoT works as expected:

Image

Also worth noting that this document doesn't have any embedded samples in it. This means might be an issue with the MarkdownTextBlock being used by the gallery.

@Arlodotexe
Copy link
Member Author

We're still using 7.1.2 for the Markdown renderer in the Gallery:

These will need to be updated to the latest version of MarkdownTextBlock in Labs.

@Arlodotexe Arlodotexe self-assigned this Oct 24, 2024
@Arlodotexe
Copy link
Member Author

Looking through the new Markdig-based Markdown control, I'm not seeing any obvious way to handle clicked links in the consuming application.

I see the library has an AutoLinkParser that takes an AutoLinkOptions.OpenInNewWindow, but AutoLink seems to be centered around detecting and making raw links clickable in the renderer. It's not clear where or how link clicks are handled from code-behind.

Looking at another UI project that uses Mardig, markdig.wpf, we find that their sample app is routing "hyperlink clicks" through FrameworkElement CommandBindings. Digging further, they've connected this binding through a Hyperlink object that is passed to a custom wpf-based LinkInlineRenderer.

We'll need to create a similar custom link renderer in the MarkdownTextBlock control offered in Labs before we can move forward with this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked bug Something isn't working regression What was working is now broke sample app 🖼️
Projects
Status: 🛑 Blocked
Development

No branches or pull requests

1 participant