<Button Name="okButton" Click="okButton_Click" IsDefault="True">OK</Button>so is obviously not intended as a standalone running example. Simplest way to add the handler is to delete the Click attribute and re-add it - that should create the codebehind stub for you. No idea what code you need in there though :-{
> ><Window > >xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" >xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >x:Class="Navigate" >Title="Navigate" >Height="130" >Width="500" >ResizeMode="NoResize" >ShowInTaskbar="False" >WindowStartupLocation="CenterOwner" >FocusManager.FocusedElement="{Binding ElementName=Url}"> > <Grid> > <Grid.Resources> > <Style TargetType="{x:Type Grid}"> > <Setter Property="Margin" Value="10" /> > </Style> > <Style TargetType="{x:Type Label}"> > <Setter Property="Margin" Value="30,0,5,5" /> > <Setter Property="Padding" Value="0,0,0,5" /> > </Style> > <Style TargetType="{x:Type TextBox}"> > <Setter Property="Margin" Value="30,0,10,10" /> > <Setter Property="AutoWordSelection" Value="True" /> > </Style> > <Style TargetType="{x:Type StackPanel}"> > <Setter Property="Orientation" Value="Horizontal" /> > <Setter Property="HorizontalAlignment" Value="Right" /> > </Style> > <Style TargetType="{x:Type Button}"> > <Setter Property="Width" Value="70" /> > <Setter Property="Height" Value="25" /> > <Setter Property="Margin" Value="5,0,0,0" /> > </Style> > </Grid.Resources> > <Grid.ColumnDefinitions> > <ColumnDefinition Width="Auto" /> > <ColumnDefinition /> > </Grid.ColumnDefinitions> > <Grid.RowDefinitions> > <RowDefinition Height="Auto" /> > <RowDefinition Height="Auto" /> > <RowDefinition Height="Auto" /> > </Grid.RowDefinitions> > <!-- Label and URL --> > <Label Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0">Type an >Internet address and My Own WPF Browser will open it for you > </Label> > <TextBox Name="Url" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"> > </TextBox> > <!-- Accept or Cancel--> > <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"> > <Button Name="okButton" Click="okButton_Click" > IsDefault="True">OK</Button> > <Button Name="cancelButton" IsCancel="True">Cancel</Button> > </StackPanel> > </Grid > ></Window> >>