Handle outgoing links in Xamarin WebView

When coding a Xamarin app that used a web view, I needed certain links to open in the existing view and some to open in Safari instead. To do this, you need to hook into the event on navigating for the web view. I then create a white-list of allowed URLs and check the target of the event. Edit the XAML code-behind file in the main Xamarin project and adjust the constructor as: The Device.OpenUri call will force opening Safari instead.

read more

Plugin: Ensure Single Event Handler

As an update to "Ensuring single instance of event handlers", I wrote a plug-in to handle this as well. The point is, you could useoffandonbut what if there are several handlers? You will risk overwriting other events on the item. For example: This could cause issues when several events are attached to the same object. So instead, we use this: The "attach" method is my custom plugin.

read more

Ensuring Single Instance Of Event Handlers

I recently had a performance issue when an AJAX control updated the DOM and the script added event bindings to the elements. However, some elements were unchanged and the events were still added again, causing multiple events and performance degradation within the browser. The existing fix was: Sure, you can do that. An easier way is to ensure that all current events are removed on the element and then adding it again.

read more

Optimizing First Load for MVC in Azure Web Roles

Azure DevOps release pipelines are awesome for continuous deployment of code from Git repositories to Azure web roles. However, after that update the first page loadcan be slow. In my case, very slow. The warm-up took on average 90 seconds. Another great feature of cloud is hyper scale and automatic horizontal scaling. But again, I am worried about that initial page load.

read more
1 2 3 4