From 757fd9eddeb4aee19ddd6e5fa375604a0c98921a Mon Sep 17 00:00:00 2001 From: michael-hawker <24302614+michael-hawker@users.noreply.github.com> Date: Thu, 4 Jun 2020 15:13:13 -0700 Subject: [PATCH 1/2] Update WebView2 Link provided by Edge team FYI @pagoe-msft --- Microsoft.Toolkit.Forms.UI.Controls.WebView/WebView.cs | 2 +- .../WebViewCompatible.cs | 1 + Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebView.cs | 2 +- Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebViewCompatible.cs | 1 + readme.md | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebView.cs b/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebView.cs index 36e2be93..f43e6e4b 100644 --- a/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebView.cs +++ b/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebView.cs @@ -34,7 +34,7 @@ namespace Microsoft.Toolkit.Forms.UI.Controls [Description("Embeds a view into your application that renders web content using the Microsoft Edge rendering engine")] [SecurityCritical] [PermissionSet(SecurityAction.InheritanceDemand, Name = Constants.SecurityPermissionSetName)] - [Obsolete("The WebView control will be replaced by WebView2 in the future. Read more here to provide early feedback: https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2")] + [Obsolete("The WebView control will be replaced by WebView2 in the future. Read more at https://aka.ms/webview2")] public sealed partial class WebView : Control, IWebView, ISupportInitialize { private string _delayedEnterpriseId = WebViewDefaults.EnterpriseId; diff --git a/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebViewCompatible.cs b/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebViewCompatible.cs index 4255fbc1..1b4bfdc6 100644 --- a/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebViewCompatible.cs +++ b/Microsoft.Toolkit.Forms.UI.Controls.WebView/WebViewCompatible.cs @@ -15,6 +15,7 @@ namespace Microsoft.Toolkit.Forms.UI.Controls [DefaultEvent(Constants.ComponentDefaultEvent)] [Docking(DockingBehavior.AutoDock)] [Description("Embeds a view into your application that renders web content using the a rendering engine")] + [Obsolete("The WebViewCompatible control will be replaced by WebView2 in the future. Read more at https://aka.ms/webview2")] public class WebViewCompatible : Control, IWebViewCompatible { private readonly IWebViewCompatibleAdapter _implementation; diff --git a/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebView.cs b/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebView.cs index 02448b87..c7b68530 100644 --- a/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebView.cs +++ b/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebView.cs @@ -49,7 +49,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls /// [ToolboxItem(true)] [DesignTimeVisible(true)] - [Obsolete("The WebView control will be replaced by WebView2 in the future. Read more here to provide early feedback: https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2")] + [Obsolete("The WebView control will be replaced by WebView2 in the future. Read more at https://aka.ms/webview2")] public sealed partial class WebView : WebViewHost, IWebView, IWebViewCompatible { private static readonly DependencyProperty EnterpriseIdProperty = DependencyProperty.Register( diff --git a/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebViewCompatible.cs b/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebViewCompatible.cs index 09598db2..6c7d42e8 100644 --- a/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebViewCompatible.cs +++ b/Microsoft.Toolkit.Wpf.UI.Controls.WebView/WebViewCompatible.cs @@ -11,6 +11,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls { + [Obsolete("The WebViewCompatible control will be replaced by WebView2 in the future. Read more at https://aka.ms/webview2")] public class WebViewCompatible : UserControl, IWebViewCompatible, IDisposable { public static DependencyProperty SourceProperty { get; } = DependencyProperty.Register(nameof(Source), typeof(Uri), typeof(WebViewCompatible)); diff --git a/readme.md b/readme.md index 2216420e..6cab8b09 100644 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ Want to see the toolkit in action before jumping into the code? Download and pla ## WebView Notice **New:** _Try out the pre-release preview of WebView2 for .NET [here](https://docs.microsoft.com/en-us/microsoft-edge/webview2/releasenotes#09515-prerelease)._ 🎉🎉🎉 -WebView2 will replace the WebView control in the toolkit, as laid out in the introduction to [WebView2 here](https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2). 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. +WebView2 will replace the WebView control in the toolkit, as laid out in the introduction to [WebView2 here](https://aka.ms/WebView2). 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](https://github.com/MicrosoftEdge/WebViewFeedback). Thank you for using WebView! From 2029cd2fff207d8682347fd5b7fa1c45567da4b4 Mon Sep 17 00:00:00 2001 From: michael-hawker <24302614+michael-hawker@users.noreply.github.com> Date: Fri, 5 Jun 2020 00:51:59 -0700 Subject: [PATCH 2/2] Suppress warning on Obsolete --- Microsoft.Toolkit.Sample.Forms.App/Form1.Designer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Microsoft.Toolkit.Sample.Forms.App/Form1.Designer.cs b/Microsoft.Toolkit.Sample.Forms.App/Form1.Designer.cs index 0e580aaa..8770b6da 100644 --- a/Microsoft.Toolkit.Sample.Forms.App/Form1.Designer.cs +++ b/Microsoft.Toolkit.Sample.Forms.App/Form1.Designer.cs @@ -38,7 +38,9 @@ private void InitializeComponent() this.inkToolbarCustomToolButton1 = new Microsoft.Toolkit.Forms.UI.Controls.InkToolbarCustomToolButton(); this.inkCanvas1 = new Microsoft.Toolkit.Forms.UI.Controls.InkCanvas(); this.webTab = new System.Windows.Forms.TabPage(); + #pragma warning disable CS0618 // Type or member is obsolete this.webViewCompatible1 = new Microsoft.Toolkit.Forms.UI.Controls.WebViewCompatible(); + #pragma warning restore CS0618 // Type or member is obsolete this.mediaTab = new System.Windows.Forms.TabPage(); this.mediaPlayerElement1 = new Microsoft.Toolkit.Forms.UI.Controls.MediaPlayerElement(); this.sampleTab = new System.Windows.Forms.TabPage(); @@ -237,7 +239,9 @@ private void InitializeComponent() private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage webTab; private System.Windows.Forms.TabPage inkingTab; + #pragma warning disable CS0618 // Type or member is obsolete private Forms.UI.Controls.WebViewCompatible webViewCompatible1; + #pragma warning restore CS0618 // Type or member is obsolete private Forms.UI.Controls.InkCanvas inkCanvas1; private System.Windows.Forms.TabPage mediaTab; private Forms.UI.Controls.MediaPlayerElement mediaPlayerElement1;