<Window xmlns:Controls="clr-namespace:Controls"  x:Class="mpvnet.InputWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="Input Editor" Height="500" Width="750" FontSize="13"
        Loaded="Window_Loaded" Closed="Window_Closed" ShowInTaskbar="False">
    <Window.Resources>
        <Style x:Key="DataGrid_Font_Centering" TargetType="{x:Type DataGridCell}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}">
                            <ContentPresenter VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Controls:SearchTextBoxUserControl HintText="Type ? to get help." x:Name="SearchControl" Width="300" Margin="0,20,0,20" Grid.ColumnSpan="2" />
        <DataGrid Grid.Row="1" x:Name="DataGrid" CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" AutoGenerateColumns="False" CellStyle="{StaticResource DataGrid_Font_Centering}">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Menu"  Binding="{Binding Path}"/>
                <DataGridTemplateColumn Header="Input">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button MinHeight="20" Click="ButtonClick">
                                <TextBlock Text="{Binding Input}"></TextBlock>
                            </Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Command" Binding="{Binding Command}" MaxWidth="330" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>