MobileBlazorBindings icon indicating copy to clipboard operation
MobileBlazorBindings copied to clipboard

Changes to .NET 6 WPF BlazorWebView startup

Open Eilon opened this issue 4 years ago • 1 comments
trafficstars

  • Change startup code to wait for all properties to be set
  • Made all properties DependencyProperties to monitor property changes
  • Hooked various control lifecycle stages to attempt WebView startup

This is based on some conversations with WPF experts and much analysis. I've tried several alternatives and nothing else seemed to work. Based on docs, using a ControlTemplate seems like a reasonable approach. It does mean that developers could try to much with implementation details of this control, but I consider that to simply be "not supported" if they do something wacky.

There are still unresolved issues around the following:

  • What to do if a property is changed after the Blazor app has started? Make it work? Throw? Ignore? The answer might depend on each property, but it's something we need to answer.
  • When/how to dispose/shut down the Blazor components and other resources used by the control? Sadly there is no good answer to this in WPF. I am still looking into options for this.

Eilon avatar Feb 24 '21 23:02 Eilon

Oops @SteveSandersonMS I forgot to tag you on this! 😁 If you could take a quick look for a sanity check, I will re-apply these changes to the big PR in the ASP.NET Core repo.

Eilon avatar Mar 01 '21 17:03 Eilon