-
Notifications
You must be signed in to change notification settings - Fork 222
[Fix]Crashes in model doc page: WinUI element hierarchy and UI thread reentrancy violations #549
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
Changes from 10 commits
298b4ab
a04fce0
ed863d5
dc692bf
96384bb
861ec7b
23f3eb8
66e3ea7
d3904a3
5810837
e339a47
c765aec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,28 +249,38 @@ | |
| (AIToolkitAction action, ModelDetails modelDetails) = ((AIToolkitAction, ModelDetails))actionFlyoutItem.Tag; | ||
|
|
||
| string toolkitDeeplink = modelDetails.CreateAiToolkitDeeplink(action); | ||
| bool wasDeeplinkSuccesful = true; | ||
| try | ||
| _ = Task.Run(() => | ||
| { | ||
| Process.Start(new ProcessStartInfo() | ||
| bool wasDeeplinkSuccesful = true; | ||
| try | ||
| { | ||
| FileName = toolkitDeeplink, | ||
| UseShellExecute = true | ||
| }); | ||
| } | ||
| catch | ||
| { | ||
| Process.Start(new ProcessStartInfo() | ||
| Process.Start(new ProcessStartInfo() | ||
| { | ||
| FileName = toolkitDeeplink, | ||
| UseShellExecute = true | ||
| }); | ||
| } | ||
| catch | ||
| { | ||
| FileName = "https://learn.microsoft.com/en-us/windows/ai/toolkit/", | ||
| UseShellExecute = true | ||
| }); | ||
| wasDeeplinkSuccesful = false; | ||
| } | ||
| finally | ||
| { | ||
| AIToolkitActionClickedEvent.Log(AIToolkitHelper.AIToolkitActionInfos[action].QueryName, modelDetails.Name, wasDeeplinkSuccesful); | ||
| } | ||
| try | ||
| { | ||
| Process.Start(new ProcessStartInfo() | ||
| { | ||
| FileName = "https://learn.microsoft.com/en-us/windows/ai/toolkit/", | ||
| UseShellExecute = true | ||
| }); | ||
| } | ||
| catch | ||
| { | ||
| // Silently fail if fallback also fails | ||
| } | ||
|
Check failure on line 276 in AIDevGallery/Pages/Models/ModelPage.xaml.cs
|
||
| wasDeeplinkSuccesful = false; | ||
| } | ||
| finally | ||
| { | ||
| AIToolkitActionClickedEvent.Log(AIToolkitHelper.AIToolkitActionInfos[action].QueryName, modelDetails.Name, wasDeeplinkSuccesful); | ||
| } | ||
| }); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -312,22 +322,28 @@ | |
| return; | ||
| } | ||
|
|
||
| try | ||
| _ = Task.Run(() => | ||
| { | ||
| var psi = new ProcessStartInfo | ||
| try | ||
| { | ||
| FileName = uri.AbsoluteUri, | ||
| UseShellExecute = true | ||
| }; | ||
| Process.Start(psi); | ||
| } | ||
| catch (Exception ex) when (ex is Win32Exception | ||
| || ex is InvalidOperationException | ||
| || ex is PlatformNotSupportedException) | ||
| { | ||
| ModelDetailsLinkClickedEvent.Log($"OpenFailed: {uri} | {ex.GetType().Name}: {ex.Message}"); | ||
| ShowDialog(message: errorMessage); | ||
| } | ||
| var psi = new ProcessStartInfo | ||
| { | ||
| FileName = uri.AbsoluteUri, | ||
| UseShellExecute = true | ||
| }; | ||
| Process.Start(psi); | ||
| } | ||
| catch (Exception ex) when (ex is Win32Exception | ||
| || ex is InvalidOperationException | ||
| || ex is PlatformNotSupportedException) | ||
| { | ||
| ModelDetailsLinkClickedEvent.Log($"OpenFailed: {uri} | {ex.GetType().Name}: {ex.Message}"); | ||
| DispatcherQueue.TryEnqueue(() => | ||
| { | ||
| ShowDialog(message: errorMessage); | ||
| }); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| private async void ShowDialog(string? message) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.