Skip to content

Mutiple webview in wpf TabControl, only first (visible) will load #3818

Open
@cuiliang

Description

@cuiliang

Description
I want to load mutiple webpages at same time, so I add a TabControl and Bind a WebView2 control for each TabItem.
When window loaded, only the first tab loaded with DocumentTitleChanged,FaviconChanged events fired.
The other tabs only load after the tab was clicked.

Demo:
You can see the title will only update after tab was activated. ( The icons was get from some public service based on url, not from webview)

lazyload_webview2.mp4

I know this maybe a design decision, wish there is some option to allow loading content without make webview visible or some other ways to get title and icon of the webpage before activating the tabs.

Version
SDK: 1.0.1938.49
Runtime: 117.0.2045.36
Framework: WPF
OS: Win11

Regression
Was this working before but has regressed? No
If yes, what version did this last work on?

Repro Steps
Binding WebView control into TabItem's Content.

<TabControl.ContentTemplate>
    <DataTemplate>
        <ContentControl Margin="0" Content="{Binding WebView}" />
    </DataTemplate>
</TabControl.ContentTemplate>

Screenshots

Additional context

https://weblog.west-wind.com/posts/2022/Jul/14/Fighting-WebView2-Visibility-on-Initialization

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions