Search code examples
vb.netwindows-8hyperlinkprivacycharms-bar

Adding items to Windows 8 Settings Charms Bar


I would like to add a button to the Settings charms bar called 'Privacy Policy' that links to the url:

    http://yourdomain.com/privacypolicy

I am creating a Windows 8 application using visual studio and VB


Solution

  • The vb code in your App.xaml.vb file :

        Imports Windows.UI.ApplicationSettings
    

    Place in the onlaunched sub

        AddHandler SettingsPane.GetForCurrentView.CommandsRequested, Sub(sender, e)         e.Request.ApplicationCommands.Add(New SettingsCommand("privacy", "Online Privacy Policy", Sub() privacyGo()))
    

    Create a sub

        Private Sub privacyGo()
    
        Dim privacy As New Uri("http://myprivacy.com")
    
        Windows.System.Launcher.LaunchUriAsync(privacy)
    
    End Sub