GithubHelp home page GithubHelp logo

communitytoolkit / microsoft.toolkit.win32 Goto Github PK

View Code? Open in Web Editor NEW
385.0 33.0 89.0 1.41 MB

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.

Home Page: https://aka.ms/windowsappsdk

License: Other

C# 97.58% HTML 0.14% JavaScript 0.01% Batchfile 0.02% PowerShell 1.70% C++ 0.53% C 0.03%
windows-toolkit windows-10 uwp wpf winforms windows-forms windows-xaml-host xaml-islands

microsoft.toolkit.win32's Introduction

topic languages products
sample
csharp
windows

Windows Community Toolkit - WPF and Windows Forms

This repository contains all controls for WPF and WinForms to simplify and demonstate usage of UWP controls.

For everything else in the Windows Community Toolkit (UWP controls, .NET Standard web services, helpers and more), start here

๐Ÿšจ Archival Notice - 8/30/2023

With the release of Xaml Islands for Windows App SDK 1.4 this repo is being archived.

All feature/issue/discussion inquires related to XAML Islands should be directed to the WindowsAppSDK repository here.

XAML Islands Notice

The set of WPF and WinForms controls found here are only designed to work with .NET Core 3.1, not .NET 5 and above. These controls are using the XAML Islands Windows 10 APIs included within the Windows 10 OS which won't be improved anymore.

WinUI 3's XAML Islands is the path forward to these .NET apps that want to use .NET 5 and WinUI. WinUI 3's XAML Islands are still in development, and we recommend reviewing the WinUI 3 roadmap to get the latest updates. This repository will be archived once WinUI 3's XAML Islands is released.

In the meantime, we suggest you investigate WinUI 3 Desktop as a solution to access Win32 APIs while using the latest native UX platform. See here for more details.

Build Status

Target Branch Status Recommended NuGet packages version
Pre-release beta testing master Build Status MyGet

Getting Started

Please read the getting Started with the Windows Community Toolkit page for more detailed information about using the toolkit.

Documentation

All documentation for the toolkit is hosted on Microsoft Docs. All API documentation can be found at the .NET API Browser.

Windows Community Toolkit Sample App

Want to see the toolkit in action before jumping into the code? Download and play with the Windows Community Toolkit Sample App from the Store.

Controls

Control Minimum supported OS Description
WindowsXamlHost Windows 10, version 1809 Adds built-in or custom UWP controls to the User Interface (UI) of WPF or Windows Forms desktop application.
WebView Windows 10, version 1803 Uses the Microsoft Edge rendering engine to show web content.
WebViewCompatible Windows 7 Provides a version of WebView that is compatible with more OS versions. This control uses the Microsoft Edge rendering engine to show web content on Windows 10 version 1803 and later, and the Internet Explorer rendering engine to show web content on earlier versions of Windows 10, Windows 8.x, and Windows 7.
InkCanvas
InkToolbar
Windows 10, version 1809 Provide a surface and related toolbars for Windows Ink-based user interaction in your Windows Forms or WPF desktop application.
MediaPlayerElement Windows 10, version 1809 Embeds a view that streams and renders media content such as video in your Windows Forms or WPF desktop application.
MapControls Windows 10, version 1809 Enables a symbolic or photorealistic map in your Windows Forms or WPF desktop application.

WebView Notice

New: Try out the pre-release preview of WebView2 for .NET here. ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

WebView2 will replace the WebView control in the toolkit, as laid out in the introduction to WebView2 here. This means that we've deprecated the WebView control within the Toolkit and are working with the Edge team to convey all the requirements from the open issues here.

Over the next few months, they'll be processing the open requests to ensure the scenarios folks are using WebView for will be supported with its replacement in the future. You can provide feedback directly to the Edge team here. Thank you for using WebView!

Feedback and Requests

Please use GitHub Issues for bug reports and feature requests. For feature requests, please also create an entry in our UserVoice. For general questions and support, please use Stack Overflow where questions should be tagged with the tag windows-community-toolkit.

Contributing

Do you want to contribute? Here are our contribution guidelines.

Principles

  • Principle #1: The toolkit will be kept simple.
  • Principle #2: As soon as a comparable feature is available in the Windows SDK for Windows 10, it will be marked as deprecated.
  • Principle #3: All features will be supported for two Windows SDK for Windows 10 release cycles or until another principle supersedes it.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

Roadmap

Read what we plan for next iterations, and feel free to ask questions.

By adding this (NuGet repo | Gallery) to your NuGet sources in Visual Studio, you can also get pre-release packages of upcoming versions.

.NET Foundation

This project is supported by the .NET Foundation.

microsoft.toolkit.win32's People

Contributors

andreas-hjortland avatar azchohfi avatar dhowett avatar gegao18 avatar granitestatehacker avatar herrickspencer avatar huoyaoyuan avatar karlerickson avatar kmahone avatar kmelmon avatar kyaa-dost avatar lhak avatar michael-hawker avatar nmetulev avatar ocalvo avatar ranjeshj avatar rjmurillo avatar ryalanms avatar sylveon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microsoft.toolkit.win32's Issues

UWP content in XAML host control is sometimes not correctly sized

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

I noticed an issue where the XAML content inside a XAML host was not sized correctly after dpi changes. This seems to be a more general issue during rapid changes of the host control size. The following code reproduces the issue:

Create a host control (winforms) with a fixed size and a UWP button:

xamlHost = new WindowsXamlHost();
xamlHost.Width = 200;
xamlHost.Height = 200;

Windows.UI.Xaml.Controls.Button b = new Windows.UI.Xaml.Controls.Button();
b.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch;
b.Content = "Test";
b.Click += B_Click;
xamlHost.Child = b;

this.Controls.Add(xamlHost);

Now change the size twice in the click handler

private async void B_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
     xamlHost.Width = 400;
     xamlHost.Width = 200;
}

After clicking the button, the host control will now have the expected width of 200, but the UWP button will be clipped because it has a width of 400. I have tried to debug this issue and the toolkit code seems to correctly change the size of the host control. However, after all the size changes, the root UWP element only sees a single layout pass with the outdated width. Unfortunately, the placement of the UWP content in the XAML host control is not handled by the toolkit code, so I have not a found a way to fix this issue.

Expected behavior

UWP content should be sized according to the host size.

Minimal reproduction of the problem with instructions

See above

Environment

Nuget Package(s): 

Package Version(s): 5.0

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [X] Insider Build (build number:  18272)

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.8 )
- [ ] 2017 Preview (version: )

WebViewCompatible does not render as expected in designer

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When adding the WebViewCompatible to a WPF surface, the web page is rendered but not to the dimensions requested.

image

Expected behavior

When layout is set to Auto (default) for the control, the control should stretch into the available area. The behavior is as expected at runtime.

Minimal reproduction of the problem with instructions

WebViewCompatible_WPF_Designer_Size.zip

MainWindow.xaml

<Window xmlns:Controls="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls.WebView"  x:Class="WebViewCompatible.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WebViewCompatible"
        mc:Ignorable="d"
        Title="WebViewCompatible Browser" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <Grid>
                <Button HorizontalAlignment="Left" Click="OnBackClicked">Back</Button>
                <Label x:Name="LoadingLabel" HorizontalAlignment="Center" Visibility="Collapsed">Loading...</Label>
                <Button HorizontalAlignment="Right" Click="OnForwardClicked">Forward</Button>
            </Grid>
        </StackPanel>
        <Controls:WebViewCompatible Grid.Row="1" x:Name="Browser" Source="https://www.bing.com" NavigationStarting="BrowserNavigating" NavigationCompleted="BrowserNavigated" MinHeight="92" MinWidth="375" />
    </Grid>
</Window>

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 4.1.0-build.83

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] Insider Build (build number: 18244)

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.8.4)
- [ ] 2017 Preview (version: )

WebView hangs in EndInit() when run as administrator

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Start Visual Studio as administrator.
Create a new WinForms application.
Add a WebView control to the form.
Run the application.
The form does not appear. When you click "Break All " to pause debugging, the current debugging location is inside "((System.ComponentModel.ISupportInitialize)(this.webView1)).EndInit();" in InitializeComponents().

Expected behavior

The WinForm should open the web page normally.

Minimal reproduction of the problem with instructions

Run the application.

Environment

Nuget Package(s):
Microsoft.Toolkit.Win32.UI.Controls 4.0.2

Windows 10 Build Number:
April 2018 Update (17134)

App min and target version:
I'm not sure where to find this.

Device form factor:
Desktop

Visual Studio
2017 (version: 15.7.6)

Add targets file for WindowsXamlHost nugets to automaticly reference the Windows references

I'm submitting a...

  • Feature request (UserVoice request: )

Current behavior

When developers use the WindowsXamlHost nuget packages they need to add all the references manually to use Windows UWP APIs: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-enhance#first-set-up-your-project

Expected behavior

The nuget packages should add those references automatically via a targets file

Environment

Nuget Package(s): 
Microsoft.Toolkit.Forms.UI.XamlHost
Microsoft.Toolkit.Wpf.UI.XamlHost

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: )
- [ ] 2017 Preview (version: )

Xaml Island does not work on .Net Core 3.0

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Can't add any of the Microsoft.Toolkit.Forms.* or Microsoft.Toolkit.Wpf.* to a .Net Core 3.0 (alpha right now, but we should be prepared) Windows Forms or Wpf project.
NuGet does not allow because it is a different target framework and right now we ship only the .net full framework version of those controls.

Expected behavior

You should be able to add this packages and have a functioning Xaml Island on any Wpf or WinForms app, independent of it's underling .Net implementation.

Minimal reproduction of the problem with instructions

Install .Net Core 3.0 alpha, run "dotnet new wpf", open it in VS, try to add any of the NuGet packages.

Environment

Nuget Package(s): Microsoft.Toolkit.Forms.* or Microsoft.Toolkit.Wpf.*

Package Version(s): 5.0 preview.

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)
- Win32 app.

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.8.7)
- [ ] 2017 Preview (version: )

WebView in Wpf wont follow z index inside canvas element.

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

microsoft.toolkit.wpf.ui.controls.webview control won't honor the Z index property of canvas element.
If I add children in canvas element whatever be the z index, webview will be the topmost element.

Expected behavior

The canvas element should honor z index property

### Minimal reproduction of the problem with instructions
the z index of different elements are shown in image .here webview index with 1 should be below text views but its on top of others.
zindexreport

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.Controls.Webview

Package Version(s): 5.0.0.0

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • [x ] April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • [] April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • [x ] Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • [x ] 2017 (version:15.8.8 )
  • 2017 Preview (version: )

net Framework Target:4.6.2

[WPF] [WebView] Control disappears when SxS in Grid with another control

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When placing the WebView control in a grid having two columns in column 1, the WebView "disappears" after window resize and movement.

Expected behavior

The WebView stays at the indicated and calculated position in the Grid

Minimal reproduction of the problem with instructions

Mainwindow.xaml

<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition />
    <ColumnDefinition />
  </Grid.ColumnDefinitions>
  <WebBrowser x:Name="WebBrowser" Grid.Column="0" Source="http://example.com" />
  <WPF:WebView x:Name="WebView" Grid.Column="1" Grid.Row="1" Source="https://html5test.com" />
</Grid>

Environment

Nuget Package(s): 
Microsoft.Toolkit.Win32.UI.Controls

Package Version(s): 
3.0.0-preview

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

WebView: System.Resources.MissingManifestResourceException when setting properties at runtime.

I'm submitting a...

Bug report (I searched for similar issues and did not find one) -->

Current behavior

When setting properties at runtime, the App will throw an exception:
System.Resources.MissingManifestResourceException

Expected behavior

It should just set the property.

Minimal reproduction of the problem with instructions

The following code will throw the exception:

        private void Form1_Load(object sender, EventArgs e)
        {
            webView1.IsPrivateNetworkClientServerCapabilityEnabled = true;
            webView1.Navigate("https://bing.com/");
        }

You can run the following project to see it:
WindowsFormsApp1.zip

Environment

Nuget Package(s): Window Toolkit Windows Forms WebView

Package Version(s): 5.01

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • [x ] October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • [x ] October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • [x ] Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: 15.9.4)
  • 2017 Preview (version: )

WebView: Need Frame name in Frame navigation events

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

FrameNavigation event arguments has only Uri information.
WebViewControlNavigationStartingEventArgs - Uri, Cancel
WebViewControlContentLoadingEventArgs - Uri
WebViewControlDOMContentLoadedEventArgs - Uri
WebViewControlNavigationCompletedEventArgs - Uri, IsSuccess, WebErrorStatus

Expected behavior

Need TargetFrameName similar to what IE provides. If possible, please provide other data as well.
eg: https://msdn.microsoft.com/en-us/library/aa768326(v=vs.85).aspx

Minimal reproduction of the problem with instructions

Not applicable

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

WPF WebView crash after logging into Spotify

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Log into Spotify

Expected behavior

Doesn't crash

Minimal reproduction of the problem with instructions

Go to https://open.spotify.com
Login
Crash at:
Edgehtml:GetFolderPath
Edgehtml:GetAppDataFolderPath
EdgeHtml:MediaHelper::ConstructAppLocalPath
...

Environment

Nuget Package(s):
Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s):
5.0.1

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: (19290)

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

When using Web Notifications API, Win32WebViewHost shows as source in Windows 10 Action Center

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When using the Web Notification API, the notification is displayed in the Windows 10 Action Center under Win32WebViewHost.

image

Expected behavior

Notification shows up in a way that is unambiguous for my application.

Minimal reproduction of the problem with instructions

Use on the sample apps to navigate to a page that uses Web Notification API (e.g. https://davidwalsh.name/notifications-api)

Environment

Nuget Package(s): 
Microsoft.Toolkit.Win32.UI.Controls

Package Version(s): 
3.0.0-preview

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] Insider Build (build number: 17340)

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

WebView can't read client certificates

I'm submitting a issue with WebView control for Winform, I use this control to browse an website with ADFS + MFA, during authentication progress it will popup and ask user to choose a certificate from client machine. it works well with Edge browser but when user do the same with WebView control, it will return 'No valid client certificate found in the request' error.

Current behavior

it end with error and can't finish the authentication

Expected behavior

User should be able to input the Pin code or select Certificate to continue the authentication.

Minimal reproduction of the problem with instructions

Browse a site enabled ADFS and MFA (Phone/SmartCard authentication)

Environment

Nuget Package(s): Microsoft.Toolkit.Forms.UI.Controls.WebView

Package Version(s): 5.0.1

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: )
- [ ] 2017 Preview (version: )

WebViewCompatible needs public void Navigate(Uri requestUri, HttpMethod httpMethod, string content = null, IEnumerable<KeyValuePair<string, string>> headers = null);

I'm submitting a...

Feature request (UserVoice request: )

Current behavior

This method is missing

Expected behavior

Have the ability to call WebViewCompatible.Navigate(Uri requestUri, HttpMethod httpMethod, string content = null, IEnumerable<KeyValuePair<string, string>> headers = null);

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] Insider Build (build number:  (18282)

App min and target version:
- [ ] Fall Creators Update (16299)
- [X] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [X] 2017 Preview (version: )

MediaPlaybackElement not rendering in WPF when using TimelineController

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Accordingly to the ms docs "MediaPlayerElement control for Windows Forms and WPF" I have created a WPF with Microsoft.Toolkit referenced to be able to use UWP controls. The Video plays as expected but as soon as i enable mp.TimelineController and disable mp.Play the video is not rendered anymore. Audio still plays and mp.TimelineController.Position gives me reasonable values.

Expected behavior

RealTimePlayback with TimelineController attached should be rendering

Minimal reproduction of the problem with instructions

	using System;
	using System.Windows;

	namespace WPF
	{
		public partial class MainWindow : Window
		{
			public MainWindow()
			{
				InitializeComponent();

				Microsoft.Toolkit.Wpf.UI.Controls.MediaPlayerElement mpe = new Microsoft.Toolkit.Wpf.UI.Controls.MediaPlayerElement();
				grid.Children.Add(mpe);

				Windows.Media.Playback.MediaPlayer wmp = new Windows.Media.Playback.MediaPlayer();
				mpe.SetMediaPlayer(wmp);

				wmp.Source = Windows.Media.Core.MediaSource.CreateFromUri(new Uri("C:/Users/DEXTER/Desktop/25.mp4"));
				wmp.RealTimePlayback = true;
				//wmp.Play(); // Working as expected.

				wmp.CommandManager.IsEnabled = false;
				wmp.TimelineController = new Windows.Media.MediaTimelineController();
				wmp.TimelineController.Start(); // Not rendering Video. Only Audio.
			}
		}
	}

Environment

Nuget Package(s): 
Microsoft.Toolkit.Wpf.UI.Controls 5.0.0-preview.gb86cb1c4cb
Microsoft.Toolkit.Wpf.UI.XamlHost 5.0.0-preview.gb86cb1c4cb

Package Version(s): 
5.0.0-preview.gb86cb1c4cb
5.0.0-preview.gb86cb1c4cb

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] Insider Build (build number: 18262.1000)

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.8.7)
- [x] 2017 Preview (version: 15.9.0)

Microsoft.Toolkit.Win32.UI.Controls NuGet migration to 5.0

I'm submitting a...

Current behavior

Version 4.0.2 and 4.0.3 are the most popular, with 5.0 releases roughly half the v4.

Expected behavior

Include major versioned package that only references the new versions we want people to migrate to as a means to get people to migrate to the new namespace and distributed packages.

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): Microsoft.Toolkit.Win32.UI.Controls

Package Version(s): 4.0.x



Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

WebView can't run as administrator

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

If you try to your app as adminstrator (elevated), the app will not show, no errors or messages, it just doesn't show.

The reason this became an issue, was that I primarily develop websites, and to debug the local IIS, Visual Studio must run as admin, so I have changed the VS shortcut to require that. Unfornately this Means, that any app launched will also run as admin.

The proplem is that it's impossible to debug, when nothing is shown.

Expected behavior

The app should run (Edge can run as admin). If that isn't possible, I suggest, you check at startup, whether it runs as admin and then throw an exception: "WebView can't run as administrator".

That will save hours of frustrating debugging for many people,

Minimal reproduction of the problem with instructions

Run Visual Studio as admin, now launch an app with WebView.

Environment

Nuget Package(s):  Microsoft Toolkit Windows Forms WebView

Package Version(s): 5.01

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x ] 2017 (version: 15.9.4)
- [ ] 2017 Preview (version: )

Add a textbox/richeditbox wrapper to easy to use handwritingview

I'm submitting a...

Feature request (UserVoice request: )

Current behavior

Haven't a sample for HandWritingView in textBox on XamlIsland.

Expected behavior

Have an easy sample like MapControl/InkCanvas in XamlIsland sample app.

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): 
Microsoft.Toolkit.Forms.UI.XamlHost
Microsoft.Toolkit.Wpf.UI.XamlHost

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: )
- [ ] 2017 Preview (version: )

WebView blocks UI thread when calling 'InvokeScriptAsync'

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

When calling 'InvokeScriptAsync', the UI threads blocks while script is running. This goes against the idea of having an asynchron method.

Expected behavior

The UI thread should be responsive.

Minimal reproduction of the problem with instructions

Run the attached app. Click the button, now try to move the form while script is running.
WindowsFormsApp1.zip

Environment

Nuget Package(s): Win32 toolkit

Package Version(s): 4.0.1

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.8.2)
- [ ] 2017 Preview (version: )

WebViewControlNewWindowRequestedEventArgs.Uri loses hash/anchor

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

I have a WebView control in a VSTO (Outlook) custom task pane. It loads a web page that has relevant links for the user's current mail.

These links include a # component that is critical to the path, like https://example.com/site#resource:id - that #resource:id is essential and is used by client side JS at the target site.

I've subscribed to the NewWindowRequested event, but in this WebViewControlNewWindowRequestedEventArgs.Uri the #resource:id has been stripped off.

This would be ok server-side as the hash is not sent, but client side it is a bug.

Expected behavior

If the link in the WebView is <a href="https://example.com/site#resource:id">test</test> then WebViewControlNewWindowRequestedEventArgs.Uri.AbsoluteUri should be https://example.com/site#resource:id.

Minimal reproduction of the problem with instructions

  • In Visual Studio 2017 create a VSTO project for Outlook.
  • Add a XAML UserControl
<UserControl ...>
    <Grid>
        <Controls:WebView ... NewWindowRequested="wbCtrl_NewWindowRequested"/>
    </Grid>
</UserControl>
  • Set the source to a page with <a href="https://example.com/site#resource:id">test</test>
  • In wbCtrl_NewWindowRequested use your favourite logging tool or just add a breakpoint to check the contents of WebViewControlNewWindowRequestedEventArgs.Uri.
  • Add a wrapper Forms.UserControl with and ElementHost containing the above control as its child
  • In the application Startup event use this.CustomTaskPanes.Add(... to add the wrapper control.
  • Run the program with Outlook
  • Click on the test link in the custom task pane.

Note that most of these steps may be uneccessary if a WebView in a standalone application exhibits the same symptoms, I haven't tested it in other contexts yet.

Environment

Nuget Package/Package Version:

  • Microsoft.Toolkit.Wpf.UI.Controls.WebView 5.0.0

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: 15.8.9)
  • 2017 Preview (version: )

Does Not Support .NET Core 3

According to the Microsoft Docs here

https://blogs.msdn.microsoft.com/dotnet/2018/12/04/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks/

One of the key advantages of .NET Core 3 for WPF is its support for XAML islands, which is available via the code in this repository.
However, the code in this repository is not compatible with .NET Core 3, so either the docs are wrong, or this is a regression, or this is now a feature request.

Does anyone have any insight into this?

I'm submitting a...

Feature request (UserVoice request: )

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

WPF WebView.NavigateToString hangs

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

WPF WebView.NavigateToString() does not return;

Expected behavior

WPF WebView.NavigateToString() completes successfully

Minimal reproduction of the problem with instructions

In WPF XAML:

<wpf:WebView Name="WebView" Loaded="WebView_OnLoaded" />

Code:

private void WebView_OnLoaded(object sender, RoutedEventArgs e)
{
    WebView.NavigateToString("<html><body><h2>This is an HTML fragment</h2></body></html>");
}

Environment

Nuget Package(s): 
Microsoft.Toolkit.Win32.UI.Controls v4.0.1

Package Version(s): 

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [X ] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

WPF App targeting .NET Framework 4.7.2

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [X ] 2017 Preview (version: 15.8.0 Preview 5 )

WinForms application crashing when using WebView

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

WinForms 4.7.1 application using WebView crashes unexpectedly through Win32WebViewHost.

Expected behavior

No crash.

Minimal reproduction of the problem with instructions

I have a dump on crash from Win32WebViewHost. I can send it to somebody (I would rather not share it publicly, not sure what might be in there).

I don't have an easily reproducible steps (yet). Seems to be related to MoveFocus(Programmatic) when I call it on form activation and two instances of same app are running. That's all I have.

Below are two related pieces from Event Log.

Fault bucket 1541769541060656014, type 5
Event Name: MoAppCrash
Response: Not available
Cab Id: 0

Problem signature:
P1: Microsoft.Win32WebViewHost_10.0.17134.1_neutral_neutral_cw5n1h2txyewy
P2: praid:Win32WebViewHost
P3: 10.0.17134.1
P4: ed1839dd
P5: CoreUIComponents.dll
P6: 10.0.17134.81
P7: fc6ad7ed
P8: c0000005
P9: 0000000000083d5c
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERF302.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERF322.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERF333.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERF333.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERF343.tmp.txt

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Microsoft.Win32W_3a4c5c13ab1b6e1a12bf5b021612f3964a86ce_7d87c779_0f51fec9

Analysis symbol: 
Rechecking for solution: 0
Report Id: 7d399022-6f82-496c-b99c-eeca9d221e3e
Report Status: 268435456
Hashed bucket: 923cbf200a8b8936c565773a9c6ffb8e
Cab Guid: 0
Faulting application name: Win32WebViewHost.exe, version: 10.0.17134.1, time stamp: 0xed1839dd
Faulting module name: ntdll.dll, version: 10.0.17134.1, time stamp: 0x207580e2
Exception code: 0xc0000374
Fault offset: 0x00000000000f4eeb
Faulting process id: 0x2b6c
Faulting application start time: 0x01d400ccd1aaa978
Faulting application path: C:\Windows\SystemApps\Microsoft.Win32WebViewHost_cw5n1h2txyewy\Win32WebViewHost.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 232a4070-3545-4fd7-ac88-3bb5412bc791
Faulting package full name: Microsoft.Win32WebViewHost_10.0.17134.1_neutral_neutral_cw5n1h2txyewy
Faulting package-relative application ID: Win32WebViewHost

Environment

Nuget Package(s):
Only Microsoft.Toolkit.Win32.UI.Controls.

Package Version(s):
3.0.0

Windows 10 Build Number:

  • Creators Update (15063)
  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • Insider Build (build number: )

App min and target version:

  • Creators Update (15063)
  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: 15.7.3)
  • 2017 Preview (version: )

WPF WebView play video on Netflix crashes in GetPlayReadyPathFromStorageFolder

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Crashes in GetPlayReadyPathFromStorageFolder playing a video on Netflix

Expected behavior

Should play video

Minimal reproduction of the problem with instructions

Go to netflix.com | sign-in | play a video

Environment

Nuget Package(s): 
Microsoft.Toolkit.Wpf.UI.Controls.WebView
Package Version(s): 
5.0.1

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] Insider Build (build number: (18290)

App min and target version:
- [ ] Fall Creators Update (16299)
- [X] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: )
- [ ] 2017 Preview (version: )

WebView - Resize form makes webview jump out of screen

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Resizing WPF application will make the webview jump out of screen and never comes back.

ezgif com-optimize

Expected behavior

Webview resizes like all other controls

Minimal reproduction of the problem with instructions

repo.zip

  1. Launch
  2. Resize form

Environment

Nuget Package(s):
Microsoft.Toolkit.Win32.UI.Controls 4.0.1
System.Net.Http 4.0.0

Windows 10 Build Number:

  • [ X] Update (1803)
  • Insider Build (build number: )

App min and target version:

  • [ X] Update (1803)
  • Insider Build (xxxxx)

Device form factor:

  • [ X] Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • [X ] 2017 (version: 15.8.3)
  • 2017 Preview (version: )

XAML Island (WindowsXamlHost) does not work with multiple WPF Windows.

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

In WPF, if you have multiple Windows and try to use the WindowsXamlHost in more than one of them, when you try to create the control on the new window, it will crash with the following error:

System.Runtime.InteropServices.COMException
  HResult=0x80004005
  Message=Unspecified error

AttachToWindow method failed because the specified HWND descends from a different top-level window than the HWND that was previously passed to AttachToWindow on the same thread. See: https://go.microsoft.com/fwlink/?linkid=875497
  Source=Microsoft.Toolkit.Wpf.UI.XamlHost
  StackTrace:
   at Microsoft.Toolkit.Win32.UI.XamlHost.IDesktopWindowXamlSourceNative.AttachToWindow(IntPtr parentWnd)
   at Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHostBase.BuildWindowCore(HandleRef hwndParent)
   at Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHost.BuildWindowCore(HandleRef hwndParent)
   at System.Windows.Interop.HwndHost.BuildWindow(HandleRef hwndParent)
   at System.Windows.Interop.HwndHost.BuildOrReparentWindow()
   at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
   at System.Windows.SourceChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
   at System.Windows.PresentationSource.OnVisualAncestorChanged(DependencyObject uie, AncestorChangedEventArgs e)
   at System.Windows.UIElement.OnVisualAncestorChanged(Object sender, AncestorChangedEventArgs e)
   at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
   at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
   at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
   at System.Windows.Media.Visual.AddVisualChild(Visual child)
   at System.Windows.FrameworkElement.set_TemplateChild(UIElement value)
   at System.Windows.Controls.ContentPresenter.UseContentTemplate.BuildVisualTree(FrameworkElement container)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Window.MeasureOverrideHelper(Size constraint)
   at System.Windows.Window.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Window.SetRootVisual()
   at System.Windows.Window.SetRootVisualAndUpdateSTC()
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.CreateSourceWindowDuringShow()
   at System.Windows.Window.SafeCreateWindowDuringShow()
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at WpfIslandsMultipleWindowApp.MainWindow.<>c.<WindowsXamlHost_ChildChanged>b__1_0(Object s, RoutedEventArgs args) in C:\Users\alzollin\source\repos\WpfIslandsMultipleWindowApp\WpfIslandsMultipleWindowApp\MainWindow.xaml.cs:line 21

Expected behavior

XAML Islands work on multiple WPF Windows, even if they are running on the same thread. Managing multiple UI Threads is a lot of work, and most of the times, unnecessary.

Minimal reproduction of the problem with instructions

Just create a new WPF project, add the nugets, add the UWP WinMDs and Runtime dlls. Add a simple WindowsXamlHost to the MainWindow and make it's InitialTypeName="Windows.UI.Xaml.Controls.Button". The hook up to the ChildChanged event, like this:

private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
{
    if (((WindowsXamlHost)sender).Child is Windows.UI.Xaml.Controls.Button button)
    {
        button.Content = "Open new Window";
        button.Click += (s, args) =>
        {
            var mainWindow = new MainWindow();
            mainWindow.Show();
        };
    }
}

It will crash with the aforementioned exception.

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.XamlHost

Package Version(s): 5.0.0-preview.gb86cb1c4cb

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] Insider Build (build number: 18252)

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.8.6)
- [ ] 2017 Preview (version: )

Loading WPF WebView from an assembly and accessing WebView1.Process causes MissingManifestResourceException

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Loading WPF WebView from an assembly and accessing WebView1.Process causes MissingManifestResourceException
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Microsoft.Toolkit.Win32.UI.Controls.DesignerUI.resources" was correctly embedded or linked into assembly "Microsoft.Toolkit.Wpf.UI.Controls.WebView" at compile time, or that all the satellite assemblies required are loadable and fully signed.'

Expected behavior

No exception

Minimal reproduction of the problem with instructions

See attached. Move the contents of the wpf sample WebView MainWindow into a user control into a new assembly

Environment

<
Nuget Package(s):

Package Version(s):

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )
[WpfApp1.zip](https://github.com/windows-toolkit/WindowsCommunityToolkit/files/2611829/WpfApp1.zip)

Need an API to clear WebView cache/stored passwords

I'm submitting a...

Feature request

Current behavior

WebView class does not provide a method to clear cache.

Expected behavior

Clear method in WebView to clear cache

Minimal reproduction of the problem with instructions

Suppose you need to clear cached aspx pages to fetch them from server, there is no exposed method to achieve it.

Environment

Nuget Package(s): Microsoft.Toolkit.Win32.UI.Controls

Package Version(s): 3.0.0

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )

Crash in Wpf.WebView: The remote procedure call failed. HRESULT: 0x800706BE

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

WPF.WebView initialization crashes

Expected behavior

Wpf.WebView should succesfully initialize

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): Microsoft.Toolkit.Win32.UI.Controls-3.0.0; MahApps.Metro-1.6.5

Windows 10 Build Number:

  • Creators Update (15063)
  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • Insider Build (build number: )

App min and target version:

  • min 14393
  • target 16299

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: 15.7.5)
  • 2017 Preview (version: )

Stack Trace

The remote procedure call failed. (Exception from HRESULT: 0x800706BE)

Exception Stack:
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext()
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.Toolkit.Win32.UI.Controls.WPF.WebView.<<Initialize>b__134_0>d.MoveNext()

Thread 2 Crashed:
0   mscorlib                             0x0000000015a90063    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess  (0x06005cdb, 0x27)
1   mscorlib                             0x0000000015a9003a    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification  (0x06005cda, 0x28)
2   Microsoft.Toolkit.Win32.UI.Controls  0x00000000120501c9    at Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess+<CreateWebViewControlHostAsync>d__16.MoveNext  (0x06000394, 0x120)
3   mscorlib                             0x0000000015a90063    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess  (0x06005cdb, 0x27)
4   mscorlib                             0x0000000015a9003a    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification  (0x06005cda, 0x28)
5   Microsoft.Toolkit.Win32.UI.Controls  0x00000000120501a5    at Microsoft.Toolkit.Win32.UI.Controls.WPF.WebView+<<Initialize>b__134_0>d.MoveNext  (0x0600034e, 0xd3)

This does not happen on my own machine.

XAML Island plus Microsoft Advertising Banner Control System.TypeLoadException: Could not find Windows Runtime type Microsoft.Advertising.WinRT.UI.AdControl

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Background

Following https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/windowsxamlhost I Successfully created a UWP Class Library, created a UserControl (MyUserControl1) on it, just changed the Grid Background to red. Then on the WPF side:
<XamlHost:WindowsXamlHost x:Name="WindowsXamlHost1" InitialTypeName="UWPClassLibrary.MyUserControl1" ChildChanged="WindowsXamlHost1_ChildChanged">

It worked perfectly!!, got Red inside the WindowsXamlHost.

Current behavior

Problem arises when inside the UserControl (UWP Class Library) I Add the AdControl (Microsoft.Advertising.WinRT.UI - Microsoft.Advertising Library).
For that I follow => https://docs.microsoft.com/en-us/windows/uwp/monetize/install-the-microsoft-advertising-libraries

UWP side compiles perfect, (in fact when I follow the same guide on a UWP App I get the Advertisings).

On the WPF Side though it doesnt compile. I get a (Missing Assembly Reference to the Microsoft.Advertising library), I solve that by adding a reference to C:\Users{User}.nuget\packages\microsoft.advertising.xaml\10.1805.7001\SDK\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\References\CommonConfiguration\neutral\ Microsoft.Advertising.winmd

Now WPF compiles, but throw a runtime error => System.TypeLoadException: Could not find Windows Runtime type Microsoft.Advertising.WinRT.UI.AdControl

Expected behavior

Advertising showing in a WPF project thanks to XAML Islands

Minimal reproduction of the problem with instructions

I prepared this Word Doc that includes all the screenshots
XAML Islands plus Microsoft Advertising.docx

Environment

Nuget Package(s):

On the UWP Class Library

Microsoft.Advertising.XAML 10.1805.7001
Microsoft.NETCore.UniversalWindowsPlatform 6.2.2
UWP Extension => Microsoft Advertising SDK for XAML C:\Users\User}.nuget\packages\microsoft.advertising.xaml\10.1805.7001\SDK\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\

On the WPF Side

.NET 4.7.2
System.Runtime.WindowsRuntime C:\Windows\Microsoft.NET\Framework\v4.0.30319

System.Runtime.WindowsRuntime.UI.Xaml C:\Windows\Microsoft.NET\Framework\v4.0.30319

System.Runtime.InteropServices.WindowsRuntime C:\Windows\Microsoft.NET\Framework\v4.0.30319

Windows.Foundation.UniversalApiContract.winmd C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract\7.0.0.0\Windows.Foundation.UniversalApiContract.winmd (Copy Local = False)

Windows.Foundation.FoundationContract.winmd C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd (Copy Local = False)

*** This one is not part of the guidelines, this was aded by me
C:\Users{User}.nuget\packages\microsoft.advertising.xaml\10.1805.7001\SDK\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\References\CommonConfiguration\neutral\ Microsoft.Advertising.winmd (Copy Local = False)

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: 15.9.2 )
  • 2017 Preview (version: )

InkCanvas/Toolbar sample is degraded when Windows' dark theme is selected.

I'm submitting a Bug report (I searched for similar issues and did not find one)

Current behavior

When starting Microsoft.Toolkit.Win32.Samples.WinForms.App I have a black tab, with the ink toolbar, and can't draw (or see what I am drawing). Also when selecting an item from the toolbar, I expect something like a color selection tool.

Expected behavior

When starting Microsoft.Toolkit.Win32.Samples.WinForms.App and having the InkCanvas tab selected I expect to be able to draw.

Minimal reproduction of the problem with instructions

clone this repo, and start the Microsoft.Toolkit.Win32.Samples.WinForms.App

Environment

Also tried Nuget Package(s): 5.0.1

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )
  • 2019 Preview (version: 16.0.0 preview 1.1)

Here a screenshot of the app:
image

Webview context menu doesn't open when embedded in 64bit Outlook addon

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Create a VSTO (office addon) that uses the Windows-toolkit\WebView and host it inside Outlook. Add a context menu to this addon and attach it to the webview.

  • 32bit Outlook hosting the addon. WebView will display the context menu on right mouse click.
  • 64bit Outlook hosting the addon. WebView will NOT display the context menu on right mouse click

Expected behavior

Context menu should open the same for both 32bit & 64bit platforms.

Minimal reproduction of the problem with instructions

Sample code to reproduce this issue can be found here: https://github.com/shankslouis/64bitWebviewContextMenuIssue

Steps to repro:

  1. Download and run the sample provided on a PC running 64bit Office\Outlook.
  2. To see it in action click on New Email message
  3. Click on the button FormRegion1

image

In this screenshot you will see the webpage detected the right click but the context menu did not open when using 64bit Outlook. (It does open when using the 32bit version of Outlook)
image

To trigger the context menu without right clicking the mouse click the following button
image

Environment

Nuget Package(s): 
Microsoft.Toolkit.Win32.UI.Controls  v4.0.30319

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: )
- [ ] 2017 Preview (version: )

Microsoft Office 365 ProPlus
- [X] Version 1810 (build 11001.20074 Click-to-Run)
         Microsoft Outlook for Office 365 MSO (16.0.11001.20070) 64-bit

Regressions when using winforms XAML host in 19H1 insider builds

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Compared to Windows 10 1809, the recent insider builds show a number of regressions when using the winforms XAML host and I am not sure if these are Windows bugs or if the host control code has to be adapted:

  • Every keystroke results in two characters in text boxes Fixed
  • At least two host controls have to be created to render any UWP controls Fixed
  • After DPI changes, only the backgrounds of the UWP controls are rendered and no interaction is possible Fixed
  • FocusManager.GetFocusedElement() always returns null, even if a UWP control is focused Breaking change. Use GetFocusedElement(XamlRoot)
  • Changing focus to the next element in a UWP usercontrol with the tab key is not possible

Expected behavior

No regressions

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] Insider Build (build number: 18272 )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.8)
- [ ] 2017 Preview (version: )

Can't Close WPF WebView

Bug report (I searched for similar issues and did not find one)

Current behavior

Closing a WebView prevents new WebViews from working. Also, in my project, the UI hangs. The call stack just shows Application.Run. I've attached a sample project that shows the problem (but not the hang). Click the Do It button twice in the sample.
WpfApp1.zip

Expected behavior

I should be able to close a WebView without issues

Minimal reproduction of the problem with instructions

Create a UserControl and add a WebView. Close the WebView, remove the UserControl and add another one.
private void Button_Click(object sender, RoutedEventArgs e)
{
if (webView1 != null)
{
webView1.Close();
grid.Children.Remove(webView1);
webView1 = null;
}
else
{
webView1 = new UserControl1();
grid.Children.Add(webView1);
Grid.SetRow(webView1, 1);
}
}

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 5.0.1

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number:(18305.1003 )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

Execute Javascript before window.onload event

I'm submitting a Question

I 'd like to execute Javascript code before window.onload() event.

Specifically, I want to do this;
var javascriptString = "window.onload=function(){ ... }";
webBrowser.InvokeScriptAsync("eval", new string[] { javascriptString });

But I am not sure in which event handler I should put this code ...

Environment

Nuget Package(s):  Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 5.0.1

Device form factor:
- [ ] Desktop

Visual Studio 
- [ ] 2017 (version: )

WebView: Viewing Properties crashes Visual Studio

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

When clicking on a WebView in Visual Studio Windows Forms Designer, there are no Properties shown in the Properties Window.

It gets worse: When clicking on the dropdown box in the Properties window and select the WebView, Visual Studio crashes!

Expected behavior

Display properties.

Minimal reproduction of the problem with instructions

Open the attached project in VS or create a new project, no special requirements (it must have a WebView of course).

WindowsFormsApp1.zip

Environment

Nuget Package(s):  Microsoft Toolkit Windows Forms WebView

Package Version(s): 5.01

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ x] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version:  15.9.4)
- [ ] 2017 Preview (version: )

Need to Zoom in WPF WebView

Feature request (UserVoice request: )

Current behavior

Unable to zoom

Expected behavior

Able to zoom

Minimal reproduction of the problem with instructions

I didn't create a user voice request for this because I'm not sure if there is already a way to do this.
I am able to do this on win7/8 with WebViewCompatible by casting/using IE COM apis.

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 5.0.1

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: (18305.1003)

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

WebView does not work in the following cases

Please note when migrating an implementation from WebBrowser that the API has changed significantly. The web view provided for Windows Forms and WPF is a subset of the UWP WebView functionality, which may not have the functionality of WebBrowser or may have similar functionality (but under a different API).

This list contains issue specific to the Win32 WebView provided for Windows Forms and WPF.

  • Unable to use WebVR. (#2208) Win32WebView does not currently support WebVR. Meanwhile, if you need WebVR you can use either UWP WinJS/PWA or WebView (out of process).
  • Unable to play protected media (e.g. Netflix, Spotify). Storage for protected content could not be allocated. App crash.
  • Unable to show UI from web pages.
  • High-DPI / Scaling.
    • #2210 Hit targets are off. Fixed in Insider 17681.
    • #2076 WPF WebView does not fill 100% of area. Fixed in 4.0 via #2496
  • Cannot access DOM.
    • Use workaround
WebView.NavigationCompleted += (o, e) => {
  string html = WebView.InvokeScript("eval", "document.documentElement.outerHTML");
  โ€ฆ
};
WebView.NavigationCompleted += (o, e) => {
 string script = "document.body.style.background = '#FF00FF';";
 WebView.InvokeScriptAsync("eval", script);
};

Environment

Nuget Package(s): 
Microsoft.Toolkit.Win32.Controls.UI

Package Version(s): 
4.0.1

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [x] Insider Build (build number: 17733)

WPF WebView crash when calling InvokeStringAsync

I'm submitting a...

Current behavior

I'm hosting a WebView control in a simple WPF application. I call NavigateToString to load a script. Then the application always crash on InvokeScriptAsync.

Native callstack:

00 0000004b`e079c2f0 00007ffb`407186cf EdgeManager!wil::details::ReportFailure+0xec
01 0000004b`e079d830 00007ffb`40707881 EdgeManager!wil::details::ReportFailure_Hr+0x3f
02 0000004b`e079d890 00007ffb`407487b3 EdgeManager!wil::details::in1diag3::_FailFast_Hr+0x29
03 0000004b`e079d8e0 00007ffb`40745562 EdgeManager!WebViewControlWinRTHelpers::CreateWinRTUriFromString+0x67
04 0000004b`e079d950 00007ffa`78aa1e32 EdgeManager!Windows::Web::UI::WebViewControlBase::get_Source+0x92

Minimal reproduction of the problem with instructions

Repro project: WpfApp1.zip

Just launch it and click on the button

Environment

Nuget Package(s): 

Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 

5.0.0-preview.gb86cb1c4cb

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [X] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.8.8)
- [ ] 2017 Preview (version: )

WebView Samples

I've posted some samples in a repo at rjmurillo/webview-samples that demonstrate various instantiation scenarios. Right now there are samples for C# (Windows Forms and WPF), and a sample app in CPP

Environment

Windows 10 Build Number:

  • April 2018 Update (17134)

App min and target version:

  • April 2018 Update (17134)

WindowXamlHost only instantiates the Platform Host API if the OS is at least 1803 to avoid to crash

I'm submitting a...

  • Feature request

Current behavior

When an unpackaged app with a Xaml Island is running in an OS version lower than 1803, the app should use the IsApiContractPresent to verify whether the OS is the right now. In other case the app crashes. Hence this must be done by every app; the WindowsXamlHost should implement it instead of the app.

Expected behavior

An unpackaged app with a Xaml Island running in an OS version lower than 1803 doesn't crash.

Minimal reproduction of the problem with instructions

Run a WPF or WinForm unpackaged app with a Xaml Island (for instance with a Button) in the Fall Creators Update (16299) OS. The app crashes.

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [x ] Fall Creators Update (16299)
- [x ] April 2018 Update (17134)
- [x ] October 2018 Update (17763)
- [x ] Insider Build (build number: )

App min and target version:
- [x ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [x] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [x] Mobile
- [x] Xbox
- [x] Surface Hub
- [x] IoT

Visual Studio 
- [x] 2017 (version: )
- [x] 2017 Preview (version: )

TryAttachProcessExitedEventHandler blocks (never returns) while inside the VS debugger

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Inside the TryAttachProcessExitedEventHandler method the WebView1?.Process is blocking and never letting the handler to complete. I think it's also the reason why WebView is not rendering while debugging.

Expected behavior

TryAttachProcessExitedEventHandler should complete.

Minimal reproduction of the problem with instructions

Open the Microsoft.Toolkit.Sample.Wpf.WebView project in Visual Studio and debug it using F5

Environment

Nuget Package(s): 
Microsoft.Toolkit.Wpf.UI.Controls
Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 
5.0.0-preview.gb86cb1c4cb

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [X ] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X ] 2017 (version: )
- [ ] 2017 Preview (version: )

Webview control not displaying any page

I'm submitting a...

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x ] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x ] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x ] 2017 (version: )
- [ ] 2017 Preview (version: )

Webview control not loading any page... No event is invoking.
my system configuration is
Visual Studio 2017 .NetFramework 4.6.2 and 4.7.1
Windows 10 version 1803 OS Build 17134.81
My development machine is in Hyper-V Manager
Even I have tried github samples... same issue. no error showing in output window
what could be reason ?

Regards
Naresh

microsoft.toolkit.wpf.ui.controls.webview control goes out of scroll view

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

when microsoft.toolkit.wpf.ui.controls.webview control placed inside another scrollview ,as we scroll the webview goes out of bounds of scrollview covering other controls.

Expected behavior

the controls places inside scrollview should be confined to its bounds.

Minimal reproduction of the problem with instructions

Initial view of app

scrollinitial

After Scrolling

scrollafter

Test App
Wpftest.zip

Environment

Nuget Package(s): Microsoft.Toolkit.Wpf.UI.Controls.Webview

Package Version(s): 5.0.0.0

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • [x ] April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • [] April 2018 Update (17134)
  • October 2018 Update (17763)
  • Insider Build (xxxxx)

Device form factor:

  • [x ] Desktop
  • Mobile
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • [x ] 2017 (version: )
  • 2017 Preview (version: )

net Framework Target:4.6.2

WebView: Gaps from HtmlControl

When porting RSS Bandit to use the WinForms web view, I noticed the following gaps:

  • No ability to control image download
  • No ability to prevent video download/playback
  • No ability to control background audio
  • No ability to get into the DOM. Goal here is to get the equiv of IHTMLDocument2/IHTMLDocument3 to get the body and do things like scroll to it, etc.
  • Clear method is missing
  • No RTL support (setting RightToLeft throws)
  • No ability to get the raw html
  • No command state change (forward/back)
  • In navigation events, no IsRootPage, which is useful for embedded scenarios
  • No web progress changed, so no ability to show progress
  • No status text changed event
  • No document title changed event
  • No ability to detect/control iframes
  • No ability to handle accelerators for keyboard integration scenarios
  • No ability to detect a ctrl+click navigation so we can open a new tab and browse to the url there

Please see this PR for more context and use:
RssBandit/RssBandit#1748

Ideally I'd like to use WebView for RSS Bandit, but there's too much missing still. Look at how much I had to comment-out and disable.

Windows Forms XAML Host: Arrow buttons change focus instead of allowing interaction with the UWP control

I'm submitting a...

Bug report (I searched for similar issues and did not find one) -->

Current behavior

Pressing an arrow key on the keyboard moves the focus to the next element instead of interacting with the currently focused control. This can be reproduced by adding a slider to the XAML host element. Pressing an arrow key should change its value instead of focusing the next element. Interestingly, when packaging the app with a visual studio packaging project (desktop bridge), not only does the focus indicator change (to a solid line instead of a dashed line), but this issue also disappears.

Expected behavior

I would expect the same behavior when the app is started with the .exe file as when it is packaged as a desktop bridge app.

Minimal reproduction of the problem with instructions

  • Add a XAML host element containing a slider control
  • Changing the value with the arrow keys does not work
  • Add a packaging project
  • If the app is installed as a package, the focus indicator changes and the slider can be modified

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ X] Insider Build (build number: 17763)

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X ] Insider Build (17764)

Device form factor:
- [ X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ X] 2017 (version: 18.5.5 )
- [ ] 2017 Preview (version: )

Win32WebViewHost replaces application's Audio Session ownership

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

System sound mixer shows Win32WebViewHost process as the owner instead of the application containing the WebView control. IAudioSessionEnumerator.
win32webviewhost

It also affects WebNotifications, because clicking on the notification, it will open an empty window with title "Win32WebViewHost" instead of focusing the application containing that webview.
webnotification

Expected behavior

Application's process listed in IAusioSessionEnumerator, i.e. in the system's audio mixer dialog window instead of Win32WebViewHost.

Also WebNotification showing the proper application's name as well the callback to bring the application to the foreground.

Minimal reproduction of the problem with instructions

Navigate to any website that emits sound, YouTube, etc.
Open the Volume Mixer (right click the volume icon in systray -> select Volume Mixer).
There will be listed Win32WebViewHost instead of our application name, if more than one application, using WebView, there will be listed as many as applications using webview + sound are running.
win32webviewhost

And about web notification callback action:
Navigate to Google Play Music webapp. Turn in settings the web notifications and refresh, accept the permission request. It will show the notification. Click the notification. It will open a windows titled Win32WebViewHost and will close after a second or less.
win32webviewhostapp

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] Insider Build (build number: 17134)

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] Insider Build (17134)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.7.1)
- [ ] 2017 Preview (version: )

AppPackage creation failed

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

RHBIND : error RHB0007: Could not load input file 'Microsoft.Toolkit.Uwp.UI.srclink'.

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): Microsoft.Toolkit.Uwp.UI

Package Version(s): 5.0.0

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [Min] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [Max] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [x] Mobile
- [x] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.1.9)
- [ ] 2017 Preview (version: )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.