WPF VB.Net Tutorial

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="AboutDialog" MouseRightButtonDown="AboutDialog_MouseRightButtonDown"
        Title="About WPF Unleashed" SizeToContent="WidthAndHeight"
        Background="OrangeRed">
  
    
      WPF
    
    
    
    
      1
      2
      3
      4
      5
      6
      7
      8
      9
      
    

    
      Help
      OK
    

    test
  

//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Controls
Public Partial Class AboutDialog
  Inherits Window
  Public Sub New()
    InitializeComponent()
  End Sub
  Private Sub AboutDialog_MouseRightButtonDown(sender As Object, e As MouseButtonEventArgs)
    Console.WriteLine("Source = " & e.Source.[GetType]().Name)
    Console.WriteLine("OriginalSource = " & e.OriginalSource.[GetType]().Name & " @ " & e.Timestamp)
    Dim source As Control = TryCast(e.Source, Control)
    If source.BorderThickness <> New Thickness(5) Then
      source.BorderThickness = New Thickness(5)
      source.BorderBrush = Brushes.Black
    Else
      source.BorderThickness = New Thickness(0)
    End If
  End Sub
End Class