You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApplicationView.GetApplicationViewIdForWindow throws; a sentinel would let WinUI code run unmodified #24288
The method returns an opaque int used to tag per-window state — telemetry, view bookkeeping, multi-window dictionaries. Callers almost never branch on the value, so on a single-window platform a constant would be entirely serviceable.
Because it throws, otherwise-portable code has to be modified. Worse, the common call sites sit inside dispatcher continuations:
awaitDispatcher.RunAsync(...,()=>{varid=ApplicationView.GetApplicationViewIdForWindow(window);// throwsrefThis.GetMemory();// never runs});
There the exception is unobserved — no crash, but everything after it in the continuation is silently skipped, producing a feature that simply does nothing with no diagnostic. In microsoft/calculator this pattern appears in ApplicationViewModel, Utils.GetWindowId(), Calculator.xaml.cs and MainPage.xaml.cs.
Expected
Return a stable sentinel (e.g. -1, or a per-window id) instead of throwing, consistent with how other single-window view APIs degrade. That alone would let a large amount of upstream WinUI code run unmodified.
Notes
Found while porting microsoft/calculator to Uno 7. Verified against feature/breakingchanges.
Activity