Skip to content

Fix WPF Error 23 on empty NavigateUri + MC3074 build error#15

Merged
scanfing merged 5 commits intomainfrom
copilot/optimize-post-file-handling
Apr 28, 2026
Merged

Fix WPF Error 23 on empty NavigateUri + MC3074 build error#15
scanfing merged 5 commits intomainfrom
copilot/optimize-post-file-handling

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Hyperlink.NavigateUri expects a Uri, but IPv4Text/IPv6Text start as string.Empty. WPF's built-in converter calls new Uri(""), throws UriFormatException, and surfaces as System.Windows.Data Error 23 on every launch before the server starts.

Changes

  • Converters/StringToUriConverter.cs — new IValueConverter using Uri.TryCreate(..., UriKind.Absolute, ...), returning null for empty or invalid strings; when NavigateUri is null WPF skips conversion silently and won't fire RequestNavigate
  • Views/ShellView.xaml — register StringToUriConverter as stringToUri resource; apply it to both Hyperlink NavigateUri bindings
  • HttpFileServer.csproj — add explicit <Compile Include="Converters\StringToUriConverter.cs" /> (old-style project; omitting it caused MC3074 build error)

@scanfing scanfing marked this pull request as ready for review April 28, 2026 12:56
@scanfing scanfing merged commit 1212385 into main Apr 28, 2026
@scanfing scanfing deleted the copilot/optimize-post-file-handling branch April 28, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants