<Window x:Class="ScratchNet.SetVariableNameDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:local="clr-namespace:ScratchNet"
        xmlns:loc="clr-namespace:ScratchNet.Properties;assembly=ScriptEditor"
         WindowStartupLocation="CenterScreen"
        Title="{x:Static loc:Language.SetVarTitle}" Height="148.776"  SizeToContent="Width" Width="382.4" ShowInTaskbar="False" ResizeMode="NoResize">
    <Window.Resources>
        <local:TextNotEmptyConverter x:Key="TextNotEmptyConverter"/>
    </Window.Resources>
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*" MinHeight="20"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="{x:Static loc:Language.VariableName}" Grid.Column="0" Margin="5" VerticalAlignment="Center" Grid.ColumnSpan="2" HorizontalAlignment="Left"/>
        <TextBox Name="VariableName" Grid.Column="0" Grid.Row="1" Margin="5" Grid.ColumnSpan="4" MinWidth="300"/>
        <RadioButton Name="GlobalScope" Content="可以被所有对象访问" Grid.Column="1" Grid.Row="1" Margin="5" IsChecked="True" Visibility="Collapsed"/>
        <RadioButton Name="LocalScope" Content="只能当前对象访问" Grid.Column="2" Grid.Row="1" Margin="5" Visibility="Collapsed"/>
        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="6" >
            <Button Name="ButtonOK" Width="120" Content="{x:Static loc:Language.Confirm}" Margin="5" IsDefault="True"
                    IsEnabled="{Binding ElementName=VariableName, Path=Text, Converter={StaticResource TextNotEmptyConverter}}" Click="OnConfirm"/>
            <Button Name="ButtonCancel" Width="120" Content="{x:Static loc:Language.Cancel}" Margin="5" Click="OnCancel" IsCancel="True" Visibility="Collapsed"/>
        </StackPanel>
    </Grid>
</Window>
