Microsoft Silverlight – Resize controls in a canvas within the web browser

Using the ‘Canvas.RenderTransform’ in your base Silverlight XAML, along with some resizing logic in the base Silverlight .vb class, the controls within your browser will resize as you change the size of the browser.

In this scenario, the App.xaml Application_Startup …

Microsoft Silverlight – Error Logging to Isolated Storage

Isolated storage location is under

C:Users*username*AppDataLocalLowMicrosoftSilverlightis

To handle error logging in Silverlight, create a clsIsolatedStorage.vb

Imports System.IO
Imports System.Xml
Imports System.IO.IsolatedStorage
Imports MyApplication.clsApplicationGlobal
    Public Class clsIsolatedStorage
        Shared Sub ErrorHandler(ByVal mMode As String, ByVal Procedure As String, ByVal e As Exception)
            

Microsoft Silverlight – Error Handling in Silverlight

If you have an unhandled error sometimes Silverlight will just disappear from IE and leave a blank screen. In the App.xaml.vb under Application_UnhandledException add

e.Handled = True 

SAMPLE:

Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles Me.UnhandledException
    

Microsoft Silverlight – Create a global variable to keep track of which page you are on

This is my example of creating a global variable that keeps track of which page I am on.

Created a class clsApplicationGlobal.vb

Public NotInheritable Class clsApplicationGlobal
   Public Shared HoldThePage As String
End Class

In each form, I put the following …