<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AboutDialog"
Title="About WPF Unleashed" SizeToContent="WidthAndHeight"
Background="OrangeRed">
<Window.CommandBindings>
<CommandBinding Command="Help" CanExecute="HelpCanExecute" Executed="HelpExecuted"/>
</Window.CommandBindings>
<StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button MinWidth="75" Margin="10" Command="Help" Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}"/>
<Button MinWidth="75" Margin="10">OK</Button>
</StackPanel>
<StatusBar>asdf</StatusBar>
</StackPanel>
</Window>
//File:Window.xaml.vb
Imports System.Windows
Imports System.Windows.Input
Public Partial Class AboutDialog
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
Private Sub HelpCanExecute(sender As Object, e As CanExecuteRoutedEventArgs)
e.CanExecute = True
End Sub
Private Sub HelpExecuted(sender As Object, e As ExecutedRoutedEventArgs)
System.Diagnostics.Process.Start("http://www.java2s.com")
End Sub
End Class