Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
area/webviewCategorizes an issue or PR as relevant to the WebView controldifficulty/starter 🚀Categorizes an issue for which the difficulty level is reachable by newcomers
Description
Current behavior 🐛
- The Event OnDocumentTitleChanged is only available on the CoreWebView2 Property of the WebView2
- The Arguments parameter of the Event does always return null
Expected behavior 🎯
If the Documenttitle did change, we should be getting the new Value through the provided Argument, otherwhise it shouldnt be raised at all
How to reproduce it (as minimally and precisely as possible) 🔬
- create a new Uno App with xaml markup and mvux (should be same in mvvm)
- Add the WebView2 control in the xaml of the Page like this:
<WebView2 x:Name="MyWebView2" Source="{Binding Path=CurrentUrl, Mode=TwoWay}" />
- Register the CurrentUrl like this in your Model (or however you do the equivalent in Mvvm) or just hardcode it, should not make a difference.
IState<Uri> CurrentUrl => State<Uri>.Value(this, () => new Uri("https://platform.uno/")
- Register the EventHandler minimalistic in your codebehind of a Page:
MyWebView2.CoreWebView2.DocumentTitleChanged += (s, e) => { logger.LogInformation("Core Web View - DocumentTitleChanged, new Title as Object? Value: {Title}", e); };
You will always get null. I tryed for example to set it to the Content Property of my NavigationBar above the WebView2 control which got always null then.
Workaround 🛠️
we are needed to instead use the Value from the WebView2.CoreWebView2.DocumentTitle Property like this:
MyWebView2.CoreWebView2.DocumentTitleChanged += (s, e) =>
{
logger.LogInformation("Core Web View - DocumentTitleChanged, new Title: {Title}", MyWebView2.CoreWebView2.DocumentTitle);
MyNavigationBar.Content = MyWebView2.CoreWebView2.DocumentTitle;
};Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
All platforms 🌍
Uno.Sdk version (and other relevant versions) 📦
Uno.Sdk: 6.2.36
Extension Version: 6.2.12.12
IDE version 🧑💻
Visual Studio 2022 17.14.13
Anything else we need to know? 💬
since we are able to get a DocumentTitle from the Property itself, this means we do generally know the Value we should be getting, but somewhere in the Call Stack its not provided consistently
Metadata
Metadata
Assignees
Labels
area/webviewCategorizes an issue or PR as relevant to the WebView controldifficulty/starter 🚀Categorizes an issue for which the difficulty level is reachable by newcomers
Activity
morning4coffe-dev commentedon Nov 25, 2025
@DevTKSS I think this behavior is correct. I've looked into this, and the current behavior actually aligns with the underlying spec for
WebView2.Why this is happening: The CoreWebView2.DocumentTitleChanged event is intentionally defined as an EventHandler. According to the Microsoft documentation and WinUI parity standards, the event argument is just a placeholder and is always null by design. It does not carry the new title string in the EventArgs.
The Correct Pattern: The pattern you listed under "Workaround" is actually the intended usage pattern. The event is merely a notification trigger. To get the actual value, you must access the property directly within the handler, as the property is updated before the event is raised.
We can likely close this issue as "By Design" or "Not a Bug"
github-actions commentedon May 1, 2026
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.