MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
440 stars 52 forks source link

Relative html loading solution for WPF #574

Open amoldeshpande opened 3 years ago

amoldeshpande commented 3 years ago

in #37 , access to local files via file:// urls is called out. As mentioned at the bottom of the thread, msapp-data was identified as a preferred solution for UWP apps.

Will there be a similar solution for WPF ? Some sort of XAML attribute (e.g.,LocalFileSource instead of Source) so that I can load a bundled html file ?

Right now I'm doing a workaround where I leave the Source attribute empty in the XAML and set it in the code-behind in the MainWindow constructor using Assembly.Location. Which is fine, but I'd really prefer a XAML solution.

I didn't see that explicitly called out in #37, nor another matching issue so I thought I'd open a new issue.

AB#29998226

champnic commented 3 years ago

We are working on adding support for simplifying local file access, but it will likely still require setup in the code-behind (and then Source would work correctly). We've added this scenario to our backlog, to be able to set this through XAML. Thanks!